Ejemplo n.º 1
0
 private async void c_Checked(object sender, RoutedEventArgs e)
 {
     var s = sender as RadioButton;
     var assumption = s.DataContext as Assumption;
     _assumptionsFlyout.IsOpen = false;
     _assumptionsFlyout.Dispose();
     _assumptionsFlyout = null;
     Result.Working = true;
     assumption.SelectedWord = s.Content as string;
     var r = new SearchResult(Result);
     await r.ApplyAssumption(assumption);
     _history.Push(r);
     Result = r;
     Result.Working = false;
 }
Ejemplo n.º 2
0
        private async void AssumptionSet(object sender, SelectionChangedEventArgs e)
        {
            var s = sender as ComboBox;
            // wow.
            if (Result.Assumptions != null)
            {
                var changed =
                    Result.Assumptions.FirstOrDefault(
                        a => s != null && a.Values.SequenceEqual(s.ItemsSource as List<string>));


                if (changed != null && !_firstLoad && e.RemovedItems.Count > 0)
                {
                    var r = new SearchResult(Result);
                    await r.ApplyAssumption(changed);
                    _history.Push(r);
                    Result = r;
                }
                _firstLoad = false;
            }
        }