Exemplo n.º 1
0
        protected override void OnLoaded()
        {
            this.viewModel   = new ViewModelCustomMark(this.name, this.isOwner);
            this.DataContext = this.viewModel;

            this.UpdateLayout();

            //var textBlock = this.GetByName<FrameworkElement>("NameGrid");
            //Canvas.SetLeft(textBlock, -textBlock.ActualWidth / 2);
        }
Exemplo n.º 2
0
 protected override void OnUnloaded()
 {
     this.DataContext = null;
     this.viewModel?.Dispose();
     this.viewModel = null;
 }