예제 #1
0
        private ApplicationBar GetSearchParamsUCAppBar(SearchParamsUCBase paramsUC)
        {
            ApplicationBar           applicationBar            = ApplicationBarBuilder.Build(new Color?(), new Color?(), 0.9);
            ApplicationBarIconButton applicationBarIconButton1 = new ApplicationBarIconButton(new Uri("/Resources/check.png", UriKind.Relative));
            string appBarMenuSave = CommonResources.AppBarMenu_Save;

            applicationBarIconButton1.Text = appBarMenuSave;
            ApplicationBarIconButton applicationBarIconButton2 = applicationBarIconButton1;

            applicationBarIconButton2.Click += ((EventHandler)((sender, args) =>
            {
                if (this._searchParamsDialogService != null && this._searchParamsDialogService.IsOpen)
                {
                    this._searchParamsDialogService.Hide();
                }
                Dictionary <string, string> parameters = paramsUC.GetParameters();
                if (parameters != null && parameters.ContainsKey("offset"))
                {
                    parameters["offset"] = "0";
                }
                this.ViewModel.Parameters = parameters;
                this.ViewModel.LoadData(true, false, true, false, true);
            }));
            applicationBar.Buttons.Add(applicationBarIconButton2);
            return(applicationBar);
        }
예제 #2
0
        private void SetFiltersButton_OnClick(object sender, EventArgs e)
        {
            this.LoseTextBoxFocus();
            SearchParamsUCBase paramsUC = this._createParamsUCFunc();

            paramsUC.Initialize(this.ViewModel.Parameters);
            DialogService dialogService = new DialogService();

            dialogService.AnimationType      = DialogService.AnimationTypes.None;
            dialogService.AnimationTypeChild = DialogService.AnimationTypes.SlideInversed;
            SolidColorBrush solidColorBrush = new SolidColorBrush(Colors.Transparent);

            dialogService.BackgroundBrush = (Brush)solidColorBrush;
            ApplicationBar searchParamsUcAppBar = this.GetSearchParamsUCAppBar(paramsUC);

            dialogService.AppBar = searchParamsUcAppBar;
            SearchParamsUCBase searchParamsUcBase = paramsUC;

            dialogService.Child             = (FrameworkElement)searchParamsUcBase;
            this._searchParamsDialogService = dialogService;
            this._searchParamsDialogService.Show(null);
        }