added samples
[windows-sources.git] / sdk / samples / WPFSamples / WebBrowserControlSample / csharp / mainwindow.xaml
blobc9cdef46046a025195cb30b94e32cc0f6c4b052c
1 <Window
2     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4     x:Class="WebBrowserControlSample.MainWindow"
5     Title="WebBrowser Control Sample"
6     MinHeight="200" MinWidth="200"
7     Height="600" Width="800"
8     WindowStartupLocation="CenterScreen" Background="LightSteelBlue">
9     <DockPanel>
10         
11     <StackPanel DockPanel.Dock="Top" Background="LightSteelBlue">
13         
14         <Border Background="Black">
15           <TextBlock Margin="10,0,0,0" Text="Web Navigation Demo" FontSize="16" Foreground="White"></TextBlock>
16         </Border>
18         <!-- Standard Web Navigation Buttons -->
19         <StackPanel Orientation="Horizontal" DockPanel.Dock="Top" Margin="5">
20             <Button x:Name="backButton" Content="Back" Click="backButton_Click" />
21             <Button x:Name="forwardButton" Content="Forward" Click="forwardButton_Click" Margin="5,0,0,0"  />
22             <Button x:Name="refreshButton" Content="Refresh" Click="refreshButton_Click" Margin="5,0,0,0" />
23             <TextBlock VerticalAlignment="Center" Margin="10,0,0,0">Address:</TextBlock>
24             <TextBox x:Name="addressTextBox" Text="http://msdn.microsoft.com" Width="300" />
25             <Button x:Name="goNavigateButton" Content="Go (.Navigate)" Click="goNavigateButton_Click" IsDefault="True" />
26             <Button x:Name="goSourceButton" Content="Go (.Source)" Click="goSourceButton_Click" />
27         </StackPanel>
29         <!-- This section of controls demonstrates bridging WPF and HTML code. -->
30         <Border Background="Black">
31             <TextBlock Margin="10,0,0,0" Text="Bridging WPF and HTML Demo" FontSize="16" Foreground="White" />
32         </Border>
34         <!-- Buttons for loading an HTML doc using NavigateToString and NavigateToStream respectively. -->
35         <StackPanel Orientation="Horizontal" Margin="0,5,0,0">
36             <Button x:Name="goNavigateToStringButton" Content="Load HTML Doc (.NavigateToString)" Click="goNavigateToStringButton_Click" Margin="5,0,0,0"  />
37             <Button x:Name="goNavigateToStreamButton" Content="Load HTML Doc (.NavigateToStream)" Click="goNavigateToStreamButton_Click" Margin="5,0,0,0" />
38         </StackPanel>
39         
40         <!-- Button for Loading an HTML document with Script and a button for accessing that script. -->
41         <StackPanel Orientation="Horizontal" Margin="5">
42             <Button x:Name="loadHtmlDocWithScriptButton" Content="Load HTML Document with Script" Click="loadHtmlDocWithScriptButton_Click"/>
43             <Button x:Name="callScriptFunctionNoParamButton" Margin="17,0,0,0" Content="Call Script Function (No Parameters)" Click="callScriptFunctionNoParamButton_Click" />
44         </StackPanel>
46         <!-- Use the TextBox to pass a string as a parameter to the JavaScript function. -->
47         <StackPanel DockPanel.Dock="Top" Orientation="Horizontal" Margin="5">
48             <TextBlock DockPanel.Dock="Left" Margin="5,0,0,0" FontWeight="Bold" VerticalAlignment="Center">Message to add to HTML:</TextBlock>
49             <TextBox x:Name="messageTextBox" Width="400"  Margin="5,0,0,0" Text="Message from WPF" />
50             <Button x:Name="callScriptFunctionParamButton" Content="Call Script Function (With Parameters)" Click="callScriptFunctionParamButton_Click" />
51         </StackPanel>
53         <!-- This section of controls demonstrates bridging WPF and Microsoft Word. -->
54         <Border Background="Black">
55             <TextBlock Margin="10,0,0,0" Text="Bridging WPF and Microsoft Word Demo" FontSize="16" Foreground="White" />
56         </Border>
57         
58         <!-- Shows how to load other types of documents like a Microsoft Word document into the browser and then
59              access the document. -->
60         <StackPanel Orientation="Horizontal" Margin="5">
61             <Button x:Name="loadWordDoc" Margin="5,0,0,0" Content="Load Word Doc" Click="goNavigateToWordDoc_Click" />
62             <Button x:Name="saveWordDoc" Margin="5,0,0,0" Content="Save Word Doc" Click="saveWordDoc_Click" />
63         </StackPanel>
65         <!-- Status Bar -->
66         <StatusBar Background="Orange">
67             <StatusBarItem x:Name="informationStatusBarItem" Content="Ready" />
68         </StatusBar>
71         </StackPanel>
73         <!-- Web Browser Control -->
74         <WebBrowser x:Name="webBrowser" DockPanel.Dock="Bottom" Navigating="webBrowser_Navigating" Navigated="webBrowser_Navigated" LoadCompleted="webBrowser_LoadCompleted" />
77     </DockPanel>
78 </Window>