public ClientsView()
        {
            InitializeComponent();

            DataContext = this;

            Clients = new MyObservableCollection <Client>(App.Model.Clients);

            ClearFilter = new RelayCommand(() => { NameFilter = ""; PostalCodeFilter = ""; });
            NewCommand  = new RelayCommand(() => { App.Messenger.NotifyColleagues(App.MSG_NEW_CLIENT); });
            EditCommand = new RelayCommand <Client>(EditAction);

            ReadOnly = App.Rights(Table.CLIENT) != Right.ALL;

            RefreshCommand = new RelayCommand(() =>
            {
                //App.CancelChanges();
                Clients.Refresh(App.Model.Clients);
            },
                                              () => { return(IsValid); });



            App.Messenger.Register(App.MSG_REFRESH, () =>
            {
                Clients.Refresh(App.Model.Clients);
            });
        }
示例#2
0
        public ShowsView()
        {
            InitializeComponent();

            DataContext = this;

            Shows = new MyObservableCollection <Show>(App.Model.Shows);

            ClearFilter = new RelayCommand(() => { NameFilter = ""; DateFilter = null; });
            NewCommand  = new RelayCommand(() => { App.Messenger.NotifyColleagues(App.MSG_NEW_SHOW); });
            EditCommand = new RelayCommand <Show>((s) => { App.Messenger.NotifyColleagues(App.MSG_EDIT_SHOW, s); });

            ReadOnly = App.Rights(Table.SHOW) != Right.ALL;

            RefreshCommand = new RelayCommand(() =>
            {
                //App.CancelChanges();
                Shows.Refresh(App.Model.Shows);
            },
                                              () => { return(IsValid); });


            App.Messenger.Register(App.MSG_REFRESH, () =>
            {
                this.Shows.Refresh(App.Model.Shows);
            });
        }