Download src/ScreenGrab/Extensions/DependencyExtensions.cs from dlxjj/imradv3: direct link, hf CLI and curl.
- Browser
- Download file 635 Bytes
-
https://huggingface.co/datasets/dlxjj/imradv3/resolve/main/src/ScreenGrab/Extensions/DependencyExtensions.cs
- Command line
-
hf download hf://datasets/dlxjj/imradv3/src/ScreenGrab/Extensions/DependencyExtensions.cs
-
curl -L -o DependencyExtensions.cs https://huggingface.co/datasets/dlxjj/imradv3/resolve/main/src/ScreenGrab/Extensions/DependencyExtensions.cs
635 Bytes
| using System.Windows; | |
| namespace ScreenGrab.Extensions; | |
| public static class DependencyExtensions | |
| { | |
| /// <summary> | |
| /// Sets the value of the <paramref name="property" /> only if it hasn't been explicitly set. | |
| /// </summary> | |
| public static bool SetIfDefault<T>(this DependencyObject o, DependencyProperty property, T value) | |
| { | |
| if (DependencyPropertyHelper.GetValueSource(o, property).BaseValueSource == BaseValueSource.Default) | |
| { | |
| o.SetValue(property, value); | |
| return true; | |
| } | |
| return false; | |
| } | |
| } |