예제 #1
0
 public MaskCreatorViewModel(int x, int y, string name, MaskCreatorView window)
 {
     this.X      = x;
     this.Y      = y;
     this.Name   = name;
     this.Window = window;
     this.InitializeCommands();
 }
예제 #2
0
        private List <List <int> > GetMask(int x, int y, string name)
        {
            Task <List <List <int> > > task = new Task <List <List <int> > >(() =>
            {
                return(Application.Current.Dispatcher.Invoke(delegate
                {
                    MaskCreatorView window = new MaskCreatorView(x, y, name);
                    window.ShowDialog();
                    return window.MaskCreatorViewModel.GetMask();
                }));
            });

            task.Start();
            task.Wait();
            return(task.Result);
        }