<
UserControl
x:Class
=
"MainSail.EquipmentList.Views.EquipmentListNavigator"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
xmlns:l
=
"clr-namespace:MainSail.Common;assembly=MainSail.Common"
xmlns:local
=
"clr-namespace:MainSail.EquipmentList.Views"
mc:Ignorable
=
"d"
FontSize
=
"14"
Height
=
"500"
>
<
telerik:RadDockPanel
>
<
Border
Margin
=
"10,5,10,10"
Grid.Row
=
"1"
CornerRadius
=
"4,4,4,4"
BorderBrush
=
"#193441"
Background
=
"#DDDCC5"
BorderThickness
=
"2,2,2,2"
>
<!-- EQUIPMENT TREE -->
<
telerik:RadTreeListView
Name
=
"equipmentTreeView"
Margin
=
"8"
Background
=
"Beige"
telerik:PersistenceManager.StorageId
=
"equipmentTreeView"
ItemsSource
=
"{Binding FirstGeneration}"
telerik:StyleManager.Theme
=
"Vista"
IsDragDropEnabled
=
"True"
SelectionMode
=
"Single"
SelectionUnit
=
"FullRow"
IsSynchronizedWithCurrentItem
=
"False"
AutoGenerateColumns
=
"False"
>
I am trying to write a C# program in wpf that retrieves the content of a web page.
The first thing I tried was to try the WebRequest and WebResponse classes. This did not provide the actual displayed content. WebResponse reveils the HTML code that is sent to the browser. But I discovered that, while the page is being loaded by the browser, javascript can change what content is finally displayed in the browser.
So I decided to use the WebBrowser class.
Immediately I found that there are two WebBrowser classes. Thee is the one that is documented for WinForms and there is another that is documented for WPF. I need to understand the one documented for WPF. What I think I neeed to know what to do is to retrieve code after the "LoadCompleted" method is caused. But I do not know how to this and I cannot find any example demonstrating how this is done.
private
void
radCartesianChart1_MouseDoubleClick(
object
sender, MouseButtonEventArgs e)
{
int
index = -1;
for
(
int
i = 0; i < radCartesianChart1.Behaviors.Count; i++)
{
if
(radCartesianChart1.Behaviors[i]
is
ChartTrackBallBehavior)
{
index = i;
break
;
}
}
var mousePosition = e.GetPosition(
this
);
Telerik.Charting.DataTuple tuple = radCartesianChart1.ConvertPointToData(mousePosition);
//make sure the double-click occurred in the chart data area
if
(Convert.ToSingle(tuple.FirstlValue) > 0 && Convert.ToSingle(tuple.SecondValue) > 0)
{
if
(_ShowTrackBall ==
false
)
{
//create the TrackBallBehavior and add
if
(index == -1)
{
ChartTrackBallBehavior tb =
new
ChartTrackBallBehavior();
tb.ShowIntersectionPoints =
true
;
tb.ShowTrackInfo =
true
;
radCartesianChart1.Behaviors.Add(tb);
_ShowTrackBall =
true
;
}
}
else
{
if
(index != -1)
{
ChartTrackBallBehavior tb = radCartesianChart1.Behaviors[index]
as
ChartTrackBallBehavior;
radCartesianChart1.Behaviors.Remove(tb);
_ShowTrackBall =
false
;
}
}
}
}
<
Page
x:Class
=
"Page1"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
mc:Ignorable
=
"d"
d:DesignHeight
=
"300"
d:DesignWidth
=
"300"
Title
=
"Page1"
>
<
Grid
>
<
telerik:RadGanttView
x:Name
=
"radchart"
TasksSource
=
"{Binding Tasks}"
>
<
telerik:RadGanttView.DragDropBehavior
>
<
local:CustomDragDropBehavior
/>
</
telerik:RadGanttView.DragDropBehavior
>
<
telerik:RadGanttView.Columns
>
<
telerik:ColumnDefinition
MemberBinding
=
"{Binding Start}"
Header
=
"Start"
ColumnWidth
=
"140"
>
<
telerik:ColumnDefinition.CellEditTemplate
>
<
DataTemplate
>
<!--<telerik:RadDateTimePicker SelectedValue="{Binding Start,Mode=TwoWay}" />-->
</
DataTemplate
>
</
telerik:ColumnDefinition.CellEditTemplate
>
</
telerik:ColumnDefinition
>
<
telerik:ColumnDefinition
MemberBinding
=
"{Binding End}"
Header
=
"End"
ColumnWidth
=
"140"
>
<
telerik:ColumnDefinition.CellEditTemplate
>
<
DataTemplate
>
<!--<telerik:RadDateTimePicker SelectedValue="{Binding End,Mode=TwoWay}" />-->
</
DataTemplate
>
</
telerik:ColumnDefinition.CellEditTemplate
>
</
telerik:ColumnDefinition
>
<
telerik:ColumnDefinition
MemberBinding
=
"{Binding Progress}"
Header
=
"Progress"
ColumnWidth
=
"100"
>
<
telerik:ColumnDefinition.CellEditTemplate
>
<
DataTemplate
>
<!--<
telerik:RadNumericUpDown
Value
=
"{Binding Progress, Mode=TwoWay}"
CustomUnit
=
"%"
Minimum
=
"0"
Maximum
=
"100"
/>-->
</
DataTemplate
>
</
telerik:ColumnDefinition.CellEditTemplate
>
</
telerik:ColumnDefinition
>
</
telerik:RadGanttView.Columns
>
</
telerik:RadGanttView
>
</
Grid
>
</
Page
>
I am trying to draw some polygons and within the polygons I want to put information about the polygon.
Eventually I will have multiple textblocks in the stackpanel. I don't understand how to bind to my additional data. I am using MVVM and my polygon binds good to Points.
If I change the textblock to
<TextBlock Text="Test" /> the textblock will show in the polygon with Test. Output does not show any binding issues, it just doesn't work.
<
telerik:RadMap
x:Name
=
"radMap"
Center
=
"49.002049,-101.367682"
ZoomLevel
=
"8"
Width
=
"1350"
Height
=
"700"
>
<
telerik:InformationLayer
x:Name
=
"infoLayer"
ItemsSource
=
"{Binding Model.Items}"
>
<
telerik:InformationLayer.ItemTemplate
>
<
DataTemplate
>
<
telerik:MapPolygon
Points
=
"{Binding Points}"
Fill
=
"Green"
>
<
telerik:MapPolygon.CaptionTemplate
>
<
DataTemplate
>
<
StackPanel
Background
=
"Yellow"
>
<
TextBlock
Text
=
"{Binding SubItem}"
/>
</
StackPanel
>
</
DataTemplate
>
</
telerik:MapPolygon.CaptionTemplate
>
</
telerik:MapPolygon
>
</
DataTemplate
>
</
telerik:InformationLayer.ItemTemplate
>
</
telerik:InformationLayer
>
</
telerik:RadMap
>