|
3 | 3 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
4 | 4 | xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
5 | 5 | xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
6 | | - xmlns:cefSharp="clr-namespace:CefSharp.Wpf;assembly=CefSharp.Wpf" xmlns:local="clr-namespace:CefSharp.Wpf.Example.ViewModels" |
| 6 | + xmlns:cefSharp="clr-namespace:CefSharp.Wpf;assembly=CefSharp.Wpf" |
| 7 | + xmlns:local="clr-namespace:CefSharp.Wpf.Example.ViewModels" |
| 8 | + xmlns:system="clr-namespace:System;assembly=mscorlib" |
7 | 9 | mc:Ignorable="d" |
8 | 10 | d:DesignWidth="640" |
9 | 11 | d:DesignHeight="480" |
10 | 12 | d:DataContext="{d:DesignInstance local:BrowserTabViewModel}"> |
11 | 13 | <UserControl.Resources> |
12 | 14 | <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" /> |
| 15 | + <ObjectDataProvider x:Key="BitmapScalingModeEnum" MethodName="GetValues" ObjectType="{x:Type system:Enum}"> |
| 16 | + <ObjectDataProvider.MethodParameters> |
| 17 | + <x:Type TypeName="BitmapScalingMode"/> |
| 18 | + </ObjectDataProvider.MethodParameters> |
| 19 | + </ObjectDataProvider> |
13 | 20 | </UserControl.Resources> |
14 | 21 | <Grid> |
15 | 22 | <DockPanel> |
|
79 | 86 | Content="Bitmap Scaling Mode:" /> |
80 | 87 | <ComboBox Grid.Row="2" |
81 | 88 | Grid.Column="1" |
82 | | - Name="scalingModeCB" |
83 | | - SelectedIndex="0"> |
84 | | - <ComboBox.ItemsSource> |
85 | | - <x:Array Type="BitmapScalingMode"> |
86 | | - <BitmapScalingMode>NearestNeighbor</BitmapScalingMode> |
87 | | - <BitmapScalingMode>LowQuality</BitmapScalingMode> |
88 | | - <BitmapScalingMode>HighQuality</BitmapScalingMode> |
89 | | - </x:Array> |
90 | | - </ComboBox.ItemsSource> |
91 | | - </ComboBox> |
| 89 | + Name="scalingModeComboBox" |
| 90 | + ItemsSource="{Binding Source={StaticResource BitmapScalingModeEnum}}" |
| 91 | + SelectedIndex="1"/> |
92 | 92 | </Grid> |
93 | 93 | </GroupBox> |
94 | 94 | <GroupBox Header="Execute Javascript (asynchronously)"> |
|
190 | 190 | Title="{Binding Title, Mode=OneWayToSource}" |
191 | 191 | AllowDrop="True" |
192 | 192 | WebBrowser="{Binding WebBrowser, Mode=OneWayToSource}" |
193 | | - RenderOptions.BitmapScalingMode="{Binding ElementName=scalingModeCB, Path=SelectedItem}"> |
| 193 | + RenderOptions.BitmapScalingMode="{Binding ElementName=scalingModeComboBox, Path=SelectedItem}"> |
194 | 194 | <!-- Just an example of how you may override the BrowserSettings. Disabled by default since it looks so |
195 | 195 | incredibly ugly... --> |
196 | 196 | <!--<cefSharp:ChromiumWebBrowser.BrowserSettings> |
|
0 commit comments