private void cmbPosicao_SelectionChanged(object sender, SelectionChangedEventArgs e) { var combo = (ComboBox)sender; visao = (Opcoes)combo.SelectedItem; carregaImage(); }
public MainWindow(String modulo, ObservableCollection <Opcoes> visoes) { //this.WindowState = WindowState.Maximized; this.modulo = modulo; this.visoes = visoes; InitializeComponent(); grid.Width = SystemParameters.PrimaryScreenWidth - 100; grid.Height = SystemParameters.PrimaryScreenHeight - 100; scrollViewer.ScrollChanged += OnScrollViewerScrollChanged; scrollViewer.MouseLeftButtonUp += OnMouseLeftButtonUp; scrollViewer.PreviewMouseLeftButtonUp += OnMouseLeftButtonUp; scrollViewer.PreviewMouseWheel += OnPreviewMouseWheel; scrollViewer.PreviewMouseLeftButtonDown += OnMouseLeftButtonDown; scrollViewer.MouseMove += OnMouseMove; slider.ValueChanged += OnSliderValueChanged; this.MaxWidth = SystemParameters.PrimaryScreenWidth + 100; this.MaxHeight = SystemParameters.PrimaryScreenHeight; cmbPosicao.ItemsSource = visoes; if (visoes.Count == 1) { labelVisao.Visibility = Visibility.Hidden; menuVisao.Visibility = Visibility.Hidden; } else { labelVisao.Visibility = Visibility.Visible; menuVisao.Visibility = Visibility.Visible; } visao = this.visoes[0]; carregaImage(); carregaBotoes(); AjustaImagem(); }