Exemplo n.º 1
0
 public static IObservable <object> GetResourceObservable(this IResourceNode target, string key)
 {
     return(Observable.FromEventPattern <ResourcesChangedEventArgs>(
                x => target.ResourcesChanged += x,
                x => target.ResourcesChanged -= x)
            .StartWith((EventPattern <ResourcesChangedEventArgs>)null)
            .Select(x => target.FindResource(key)));
 }
Exemplo n.º 2
0
 private double GetDoubleResource(IResourceNode node, string key)
 {
     return((double)node.FindResource(key));
 }
Exemplo n.º 3
0
 private ThicknessViewModel GetThicknessResource(IResourceNode node, string key)
 {
     return(((Thickness)node.FindResource(key)).FromThickness());
 }
Exemplo n.º 4
0
 private ArgbColorViewModel GetColorResource(IResourceNode node, string key)
 {
     return(((Color)node.FindResource(key)).ArgbFromColor());
 }
Exemplo n.º 5
0
 protected override void Subscribed(IObserver <object> observer, bool first)
 {
     observer.OnNext(_target.FindResource(_key));
 }