コード例 #1
0
        void lbFilterConditions_Editing_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if (!(DataContext is VM_GroupFilter gf))
            {
                return;
            }

            if (!(lbFilterConditions_Editing.SelectedItem is VM_GroupFilterCondition gfc))
            {
                return;
            }

            try
            {
                GroupFilterConditionForm frm = new GroupFilterConditionForm {
                    Owner = Window.GetWindow(this)
                };
                frm.Init(gf, gfc);
                bool?result = frm.ShowDialog();
                if (!result.HasValue || !result.Value)
                {
                    return;
                }
                Window     win  = Window.GetWindow(this);
                MainWindow main = win as MainWindow;
                gf.IsBeingEdited = true;

                if (main == null)
                {
                    return;
                }
                VM_MainListHelper.Instance.ViewGroupsForms.Filter = main.GroupFilter_GroupSearch;
                VM_MainListHelper.Instance.SetGroupFilterSortingOnForms(gf);
            }
            catch (Exception ex)
            {
                Utils.ShowErrorMessage(ex);
            }
        }
コード例 #2
0
        void lbFilterConditions_Editing_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            GroupFilterVM gf = this.DataContext as GroupFilterVM;

            if (gf == null)
            {
                return;
            }

            GroupFilterConditionVM gfc = lbFilterConditions_Editing.SelectedItem as GroupFilterConditionVM;

            if (gfc == null)
            {
                return;
            }

            try
            {
                GroupFilterConditionForm frm = new GroupFilterConditionForm();
                frm.Owner = Window.GetWindow(this);
                frm.Init(gf, gfc);
                bool?result = frm.ShowDialog();
                if (result.HasValue && result.Value == true)
                {
                    Window     win  = Window.GetWindow(this);
                    MainWindow main = win as MainWindow;
                    //gf.FilterConditions.Add(gfc);

                    MainListHelperVM.Instance.ViewGroupsForms.Filter = main.GroupFilter_GroupSearch;
                    MainListHelperVM.Instance.SetGroupFilterSortingOnForms(gf);
                }
            }
            catch (Exception ex)
            {
                Utils.ShowErrorMessage(ex);
            }
        }