Advertisement
Guest User

WindowEntryView.cs

a guest
Aug 4th, 2013
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.14 KB | None | 0 0
  1.     public partial class WindowEntryView
  2.     {
  3.         public static readonly DependencyProperty WindowViewModelProperty;
  4.         public WindowViewModel WindowViewModel
  5.         {
  6.             get { return (WindowViewModel) GetValue(WindowViewModelProperty); }
  7.             set
  8.             {
  9.                 SetValue(WindowViewModelProperty, value);
  10.                 value.Refresh(); // I've putted this out of desperation to see if it would help.. it didn't.
  11.             }
  12.         }
  13.  
  14.         static WindowEntryView()
  15.         {
  16.             PropertyMetadata metadata = new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsRender); // Another attempt with no success.
  17.             WindowViewModelProperty = DependencyProperty.Register("WindowViewModel", typeof (WindowViewModel), typeof (WindowEntryView), metadata);
  18.         }
  19.  
  20.         public WindowEntryView()
  21.         {
  22.             //WindowViewModel = new WindowViewModel(19860522); This is the only attempt that made the label show something, but it didn't update later of course.
  23.             DataContext = WindowViewModel;
  24.             InitializeComponent();
  25.         }
  26.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement