Esempio n. 1
0
        private void btnExploreNotes_Click(object sender, RoutedEventArgs e)
        {
            var func = CustomFilter.TryGetValue(DataContext.GetType());

            var eo = new ExploreOptions(typeof(NoteEntity))
            {
                ShowFilters   = false,
                SearchOnLoad  = true,
                FilterOptions =
                {
                    func != null ?  func((Entity)DataContext) : new FilterOption("Target", DataContext)
                    {
                        Frozen = true
                    },
                },
                OrderOptions = { new OrderOption("CreationDate", OrderType.Ascending) },
                Closed       = (_, __) => Dispatcher.Invoke(() => ReloadNotes())
            };

            if (func == null)
            {
                eo.ColumnOptions = new List <ColumnOption> {
                    new ColumnOption("Target")
                };
                eo.ColumnOptionsMode = ColumnOptionsMode.Remove;
            }

            Finder.Explore(eo);
        }
Esempio n. 2
0
        private void btnAlerts_Click(object sender, RoutedEventArgs e)
        {
            if (DataContext == null)
            {
                return;
            }

            Entity    entity = DataContext as Entity;
            ResultRow row    = (ResultRow)((Button)sender).DataContext;

            AlertCurrentState state = (AlertCurrentState)row[0];

            var func = CustomFilter.TryGetValue(DataContext.GetType());

            var eo = new ExploreOptions(typeof(AlertEntity))
            {
                ShowFilters   = false,
                SearchOnLoad  = true,
                FilterOptions =
                {
                    func != null ? func(entity) : new FilterOption("Target", DataContext)
                    {
                        Frozen = true
                    },
                    new FilterOption("Entity.CurrentState", state)
                },
                Closed = (o, ea) => Dispatcher.Invoke(() => ReloadAlerts()),
            };

            if (func == null)
            {
                eo.ColumnOptions = new List <ColumnOption> {
                    new ColumnOption("Target")
                };
                eo.ColumnOptionsMode = ColumnOptionsMode.Remove;
            }

            Finder.Explore(eo);
        }
        private void btnExploreNotes_Click(object sender, RoutedEventArgs e)
        {
            var func = CustomFilter.TryGetValue(DataContext.GetType());

            var eo = new ExploreOptions(typeof(NoteEntity))
            {
                ShowFilters = false,
                SearchOnLoad = true,
                FilterOptions =
                {
                    func != null ?  func((Entity)DataContext) : new FilterOption("Target", DataContext) { Frozen = true },
                },
                OrderOptions = { new OrderOption("CreationDate", OrderType.Ascending) },
                Closed = (_, __) => Dispatcher.Invoke(() => ReloadNotes())
            };

            if (func == null)
            {
                eo.ColumnOptions = new List<ColumnOption> { new ColumnOption("Target") };
                eo.ColumnOptionsMode = ColumnOptionsMode.Remove;
            }

            Finder.Explore(eo);
        }
        private void btnAlerts_Click(object sender, RoutedEventArgs e)
        {
            if (DataContext == null)
                return;

            Entity entity = DataContext as Entity;
            ResultRow row = (ResultRow)((Button)sender).DataContext;

            AlertCurrentState state = (AlertCurrentState)row[0];

            var func = CustomFilter.TryGetValue(DataContext.GetType());

            var eo = new ExploreOptions(typeof(AlertEntity))
            {
                ShowFilters = false,
                SearchOnLoad = true,
                FilterOptions = 
                { 
                    func != null ? func(entity) : new FilterOption("Target", DataContext) { Frozen = true },
                    new FilterOption("Entity.CurrentState", state)
                },
                Closed = (o, ea) => Dispatcher.Invoke(() => ReloadAlerts()),
            };

            if (func == null)
            {
                eo.ColumnOptions = new List<ColumnOption> { new ColumnOption("Target") };
                eo.ColumnOptionsMode = ColumnOptionsMode.Remove;
            }

            Finder.Explore(eo);
        }