Skip to content

Commit

Permalink
WPF - Use nameof for DependencyProperty.Register instead of hardcoded…
Browse files Browse the repository at this point in the history
… strings (#2585)

* WPF - Use nameof for DependencyProperty.Register instead of hardcoded strings

* WPF - Trimmed whitespace
  • Loading branch information
merceyz authored and amaitland committed Dec 3, 2018
1 parent 73f2d5c commit 0df677a
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions CefSharp.Wpf/ChromiumWebBrowser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ protected virtual void Dispose(bool isDisposing)
DeviceScaleFactor = (float)DpiScaleFactor,
Rect = monitorInfo.Monitor, //TODO: Do values need to be scaled?
AvailableRect = monitorInfo.WorkArea //TODO: Do values need to be scaled?
};
};

return screenInfo;
}
Expand Down Expand Up @@ -1030,7 +1030,7 @@ public bool CanGoBack
/// <summary>
/// The can go back property
/// </summary>
public static DependencyProperty CanGoBackProperty = DependencyProperty.Register("CanGoBack", typeof(bool), typeof(ChromiumWebBrowser));
public static DependencyProperty CanGoBackProperty = DependencyProperty.Register(nameof(CanGoBack), typeof(bool), typeof(ChromiumWebBrowser));

#endregion

Expand All @@ -1050,7 +1050,7 @@ public bool CanGoForward
/// <summary>
/// The can go forward property
/// </summary>
public static DependencyProperty CanGoForwardProperty = DependencyProperty.Register("CanGoForward", typeof(bool), typeof(ChromiumWebBrowser));
public static DependencyProperty CanGoForwardProperty = DependencyProperty.Register(nameof(CanGoForward), typeof(bool), typeof(ChromiumWebBrowser));

#endregion

Expand All @@ -1073,7 +1073,7 @@ public string Address
/// The address property
/// </summary>
public static readonly DependencyProperty AddressProperty =
DependencyProperty.Register("Address", typeof(string), typeof(ChromiumWebBrowser),
DependencyProperty.Register(nameof(Address), typeof(string), typeof(ChromiumWebBrowser),
new UIPropertyMetadata(null, OnAddressChanged));

/// <summary>
Expand Down Expand Up @@ -1124,7 +1124,7 @@ public bool IsLoading
/// The is loading property
/// </summary>
public static readonly DependencyProperty IsLoadingProperty =
DependencyProperty.Register("IsLoading", typeof(bool), typeof(ChromiumWebBrowser), new PropertyMetadata(false));
DependencyProperty.Register(nameof(IsLoading), typeof(bool), typeof(ChromiumWebBrowser), new PropertyMetadata(false));

#endregion IsLoading dependency property

Expand All @@ -1145,7 +1145,7 @@ public bool IsBrowserInitialized
/// The is browser initialized property
/// </summary>
public static readonly DependencyProperty IsBrowserInitializedProperty =
DependencyProperty.Register("IsBrowserInitialized", typeof(bool), typeof(ChromiumWebBrowser), new PropertyMetadata(false, OnIsBrowserInitializedChanged));
DependencyProperty.Register(nameof(IsBrowserInitialized), typeof(bool), typeof(ChromiumWebBrowser), new PropertyMetadata(false, OnIsBrowserInitializedChanged));

/// <summary>
/// Event called after the underlying CEF browser instance has been created.
Expand Down Expand Up @@ -1217,7 +1217,7 @@ public string Title
/// The title property
/// </summary>
public static readonly DependencyProperty TitleProperty =
DependencyProperty.Register("Title", typeof(string), typeof(ChromiumWebBrowser), new PropertyMetadata(null, OnTitleChanged));
DependencyProperty.Register(nameof(Title), typeof(string), typeof(ChromiumWebBrowser), new PropertyMetadata(null, OnTitleChanged));

/// <summary>
/// Event handler that will get called when the browser title changes
Expand Down Expand Up @@ -1255,7 +1255,7 @@ public double ZoomLevel
/// The zoom level property
/// </summary>
public static readonly DependencyProperty ZoomLevelProperty =
DependencyProperty.Register("ZoomLevel", typeof(double), typeof(ChromiumWebBrowser),
DependencyProperty.Register(nameof(ZoomLevel), typeof(double), typeof(ChromiumWebBrowser),
new UIPropertyMetadata(0d, OnZoomLevelChanged));

/// <summary>
Expand Down Expand Up @@ -1301,7 +1301,7 @@ public double ZoomLevelIncrement
/// The zoom level increment property
/// </summary>
public static readonly DependencyProperty ZoomLevelIncrementProperty =
DependencyProperty.Register("ZoomLevelIncrement", typeof(double), typeof(ChromiumWebBrowser), new PropertyMetadata(0.10));
DependencyProperty.Register(nameof(ZoomLevelIncrement), typeof(double), typeof(ChromiumWebBrowser), new PropertyMetadata(0.10));

#endregion ZoomLevelIncrement dependency property

Expand All @@ -1325,7 +1325,7 @@ public FrameworkElement CleanupElement
/// The cleanup element property
/// </summary>
public static readonly DependencyProperty CleanupElementProperty =
DependencyProperty.Register("CleanupElement", typeof(FrameworkElement), typeof(ChromiumWebBrowser), new PropertyMetadata(null, OnCleanupElementChanged));
DependencyProperty.Register(nameof(CleanupElement), typeof(FrameworkElement), typeof(ChromiumWebBrowser), new PropertyMetadata(null, OnCleanupElementChanged));

/// <summary>
/// Handles the <see cref="E:CleanupElementChanged" /> event.
Expand Down Expand Up @@ -1387,7 +1387,7 @@ public string TooltipText
/// The tooltip text property
/// </summary>
public static readonly DependencyProperty TooltipTextProperty =
DependencyProperty.Register("TooltipText", typeof(string), typeof(ChromiumWebBrowser), new PropertyMetadata(null, (sender, e) => ((ChromiumWebBrowser)sender).OnTooltipTextChanged()));
DependencyProperty.Register(nameof(TooltipText), typeof(string), typeof(ChromiumWebBrowser), new PropertyMetadata(null, (sender, e) => ((ChromiumWebBrowser)sender).OnTooltipTextChanged()));

/// <summary>
/// Called when [tooltip text changed].
Expand Down Expand Up @@ -1433,7 +1433,7 @@ public IWebBrowser WebBrowser
/// The WebBrowser property
/// </summary>
public static readonly DependencyProperty WebBrowserProperty =
DependencyProperty.Register("WebBrowser", typeof(IWebBrowser), typeof(ChromiumWebBrowser), new UIPropertyMetadata(defaultValue: null));
DependencyProperty.Register(nameof(WebBrowser), typeof(IWebBrowser), typeof(ChromiumWebBrowser), new UIPropertyMetadata(defaultValue: null));

#endregion WebBrowser dependency property

Expand Down

0 comments on commit 0df677a

Please sign in to comment.