using System; using System.CodeDom.Compiler; using System.ComponentModel; using System.Diagnostics; using System.Linq; using System.Windows; using System.Windows.Controls; using System.Windows.Controls.Primitives; using System.Windows.Markup; using System.Windows.Media; using Gestor.Application.Helpers; using Gestor.Application.ViewModels.Generic; using Gestor.Model.Domain.Ferramentas; namespace Gestor.Application.Componentes; public class DialogTrilha : UserControl, IComponentConnector, IStyleConnector { private bool _contentLoaded; public DialogTrilhaViewModel ViewModel { get; set; } public DialogTrilha(DialogTrilhaViewModel viewModel) { ViewModel = viewModel; ((FrameworkElement)this).DataContext = ViewModel; InitializeComponent(); } private void UIElement_OnGotFocus(object sender, RoutedEventArgs e) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown DependencyObject parent = VisualTreeHelper.GetParent((DependencyObject)(UIElement)sender); while (!(parent is ListBoxItem)) { if (parent != null) { parent = VisualTreeHelper.GetParent(parent); } } ListBoxItem val = (ListBoxItem)parent; if (!val.IsSelected) { val.IsSelected = true; } } private void AdicionarFase_OnClick(object sender, RoutedEventArgs e) { ViewModel.AdicionarFase(); } private void ExcluirFase_OnClick(object sender, RoutedEventArgs e) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) object dataContext = ((FrameworkElement)(Button)sender).DataContext; Fase val = (Fase)((dataContext is Fase) ? dataContext : null); if (val != null) { ViewModel.ExcluirFase(val); } } private void UIElement_OnLostFocus(object sender, RoutedEventArgs e) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown ListBox val = ((DependencyObject)(TextBox)sender).FindAncestor().FirstOrDefault(); if (val != null) { ViewModel.UpdateFase(((Selector)val).SelectedIndex); } } [DebuggerNonUserCode] [GeneratedCode("PresentationBuildTasks", "4.0.0.0")] public void InitializeComponent() { if (!_contentLoaded) { _contentLoaded = true; Uri uri = new Uri("/Gestor.Application;component/componentes/dialogtrilha.xaml", UriKind.Relative); Application.LoadComponent((object)this, uri); } } [DebuggerNonUserCode] [GeneratedCode("PresentationBuildTasks", "4.0.0.0")] [EditorBrowsable(EditorBrowsableState.Never)] void IComponentConnector.Connect(int connectionId, object target) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown if (connectionId == 1) { ((MenuItem)target).Click += new RoutedEventHandler(AdicionarFase_OnClick); } else { _contentLoaded = true; } } [DebuggerNonUserCode] [GeneratedCode("PresentationBuildTasks", "4.0.0.0")] [EditorBrowsable(EditorBrowsableState.Never)] void IStyleConnector.Connect(int connectionId, object target) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Expected O, but got Unknown //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Expected O, but got Unknown switch (connectionId) { case 2: ((UIElement)(TextBox)target).GotFocus += new RoutedEventHandler(UIElement_OnGotFocus); ((UIElement)(TextBox)target).LostFocus += new RoutedEventHandler(UIElement_OnLostFocus); break; case 3: ((UIElement)(TextBox)target).GotFocus += new RoutedEventHandler(UIElement_OnGotFocus); ((UIElement)(TextBox)target).LostFocus += new RoutedEventHandler(UIElement_OnLostFocus); break; case 4: ((ButtonBase)(Button)target).Click += new RoutedEventHandler(ExcluirFase_OnClick); break; } } }