Ejemplo n.º 1
0
        private void CtrlSearchCommandBinding_OnExecuted(object sender, ExecutedRoutedEventArgs e)
        {
            var searchParam = new CtrlSearch
            {
                DocumentSearchType = typeof(CtrlArticle),
                SearchWindowHeader = "Artikelsuche",
                ParentUserControl  = this
            };

            searchParam.OnSearchComplete += result =>
            {
                ViewModel.Article = (CtrlArticle)result;
                ViewModel.SaveArticle();
            };

            CtrlSearch.DoSearch(searchParam);
        }
Ejemplo n.º 2
0
        private void ArticleUserControl_OnLoaded(object sender, RoutedEventArgs e)
        {
            var searchParam = new CtrlSearch
            {
                DocumentSearchType = typeof(CtrlArticle),
                SearchWindowHeader = "Artikelsuche",
                ParentUserControl  = this
            };

            searchParam.OnSearchComplete += result =>
            {
                if (result != null)
                {
                    ViewModel.Article = (CtrlArticle)result;
                    LockUserControl();
                }
                else
                {
                    ViewModel.NewArticle();
                }
            };

            CtrlSearch.DoSearch(searchParam);
        }