File tree Expand file tree Collapse file tree 3 files changed +36
-0
lines changed Expand file tree Collapse file tree 3 files changed +36
-0
lines changed Original file line number Diff line number Diff line change 111111 <Grid .RowDefinitions>
112112 <RowDefinition Height =" Auto" />
113113 <RowDefinition Height =" Auto" />
114+ <RowDefinition />
114115 </Grid .RowDefinitions>
115116 <Grid .ColumnDefinitions>
116117 <ColumnDefinition Width =" Auto" />
134135 Maximum =" 1"
135136 TickFrequency =" 0.01"
136137 Value =" 0.85" />
138+ <Label Grid.Row=" 2"
139+ Grid.Column=" 0"
140+ Content =" Zoom level:" />
141+ <Slider Grid.Row=" 2"
142+ Grid.Column=" 1"
143+ Name =" zoomSlider"
144+ Minimum =" 0"
145+ Maximum =" 1"
146+ TickFrequency =" 0.1"
147+ Value =" 0.0"
148+ ValueChanged =" SetZoomLevel" />
137149 </Grid >
138150 </GroupBox >
139151 <Label Name =" outputLabel"
Original file line number Diff line number Diff line change @@ -122,6 +122,11 @@ public void DisplayOutput(string output)
122122 outputLabel . Content = output ;
123123 }
124124
125+ public void SetZoomLevel ( object sender , RoutedPropertyChangedEventArgs < double > zoomLevelArgs )
126+ {
127+ web_view . ZoomLevel = zoomLevelArgs . NewValue ;
128+ }
129+
125130 private void control_Activated ( object sender , RoutedEventArgs e )
126131 {
127132 EventHandler handler ;
Original file line number Diff line number Diff line change @@ -235,6 +235,25 @@ namespace CefSharp
235235 void set (IJsDialogHandler^ handler) { _browserCore->JsDialogHandler = handler; }
236236 }
237237
238+ virtual property double ZoomLevel
239+ {
240+ double get () {
241+ CefRefPtr<CefBrowser> browser;
242+ if (!TryGetCefBrowser (browser)) {
243+ return 0 ;
244+ }
245+ return browser->GetZoomLevel ();
246+ }
247+ void set (double zoomLevel)
248+ {
249+ CefRefPtr<CefBrowser> browser;
250+ if (!TryGetCefBrowser (browser)) {
251+ return ;
252+ }
253+ browser->SetZoomLevel (zoomLevel);
254+ }
255+ }
256+
238257 virtual void OnInitialized ();
239258
240259 virtual void Load (String^ url);
You can’t perform that action at this time.
0 commit comments