예제 #1
0
        public void RemoveField(ThingViewModel thing, FieldViewModel field)
        {
            Debug.Assert(thing.Fields.Contains(field));

            if (!thing.Fields.Remove(field))
            {
                Debug.Assert(false);
            }

            if (thing.Source.Fields != null)
            {
                thing.Source.Fields.Remove(field.Source);
                if (thing.Source.Fields.Count == 0)
                {
                    thing.Source.Fields = null;
                }
            }

            thing.Update();
        }
예제 #2
0
 private void ViewThing(ThingViewModel viewModel)
 {
     Debug.Assert(viewModel != null);
     this.ThingViewerControl.ViewThing(viewModel.Source.Id);
     this.ViewerFlyout.IsOpen = true;
 }
예제 #3
0
 public void SetViewer(ThingViewModel thing)
 {
     this.viewerViewModel = thing;
     this.NotifyPropertyChanged(nameof(this.WindowTitle));
 }
예제 #4
0
 public WordViewModel(ThingViewModel thing, Word source)
     : base(source)
 {
     this.Thing = thing;
 }