示例#1
0
 private void UserControl_DataContextChanged(object sender, System.Windows.DependencyPropertyChangedEventArgs e)
 {
     if (!File.Exists(((ImageNote)DataContext).FileName))
     {
         ((ImageNote)DataContext).TryRootingPath();
     }
 }
示例#2
0
 private void UserControl_IsVisibleChanged(object sender, System.Windows.DependencyPropertyChangedEventArgs e)
 {
     if (IsVisible)
     {
         DiscordHelper.SetDiscordRPCStatus("Animation Exporter");
     }
 }
示例#3
0
 private void DataWindow_IsVisibleChanged(object sender, System.Windows.DependencyPropertyChangedEventArgs e)
 {
     if (this.IsVisible && IsLoaded)
     {
         DiscordRPCHelper.WhatAmIDoing("Update Dialog");
     }
 }
示例#4
0
        private void OnDataContextChanged(object sender, System.Windows.DependencyPropertyChangedEventArgs e)
        {
            if (this.posMem != null)
            {
                this.posMem.Dispose();
            }

            if (this.rotMem != null)
            {
                this.rotMem.Dispose();
            }

            this.actor = this.DataContext as Actor;

            System.Windows.Application.Current.Dispatcher.Invoke(() => { this.IsEnabled = this.actor != null; });

            if (this.actor == null)
            {
                return;
            }

            this.posMem = this.actor.GetMemory(Offsets.Main.Position);
            this.posMem.Bind(this, nameof(this.Position));

            this.rotMem = this.actor.GetMemory(Offsets.Main.Rotation);
            this.rotMem.Bind(this, nameof(this.Rotation));
        }
示例#5
0
        private void TabList_IsSelectionEnabledChanged(object sender,
                                                       System.Windows.DependencyPropertyChangedEventArgs e)
        {
            var viewModel = DataContext as CollectionViewModel;

            viewModel.SetIsSelectionEnabled.Execute(sender);
        }
 private async void UserControl_IsVisibleChanged(object sender, System.Windows.DependencyPropertyChangedEventArgs e)
 {
     if (this.Visibility == System.Windows.Visibility.Visible)
     {
         await((GanttRealViewModel)this.DataContext).Inicializar();
     }
 }
示例#7
0
        private void SimpleSpardEditor_DataContextChanged(object sender, System.Windows.DependencyPropertyChangedEventArgs e)
        {
            _spardViewModel = DataContext as SpardTemplateViewModel;

            if (_spardViewModel == null && DataContext != null)
            {
                System.Windows.FrameworkElement parent = this;
                do
                {
                    parent = VisualTreeHelper.GetParent(parent) as System.Windows.FrameworkElement;
                    if (parent == null)
                    {
                        return;
                    }

                    _spardViewModel = parent.DataContext as SpardTemplateViewModel;
                    if (_spardViewModel != null)
                    {
                        break;
                    }
                } while (true);
            }

            if (_spardViewModel != null)
            {
                _spardViewModel.AliasInserted    += SpardViewModel_AliasInserted;
                _spardViewModel.OptionalInserted += SpardViewModel_OptionalInserted;
            }
        }
 private void ButtonFinish_IsVisibleChanged(object sender, System.Windows.DependencyPropertyChangedEventArgs e)
 {
     if (ButtonFinish.IsVisible)
     {
         ButtonFinish.Focus();
     }
 }
 private void ButtonBack_IsEnabledChanged(object sender, System.Windows.DependencyPropertyChangedEventArgs e)
 {
     if (!ButtonBack.IsEnabled)
     {
         ButtonNext.Focus();
     }
 }
示例#10
0
 private async void OnIsVisibleChangedAsync(object sender, System.Windows.DependencyPropertyChangedEventArgs e)
 {
     if (DataContext is ComposeControlViewModel vm)
     {
         await vm.GetUserInfoAsync().ConfigureAwait(false);
     }
 }
 private void UserControl_IsVisibleChanged(object sender, System.Windows.DependencyPropertyChangedEventArgs e)
 {
     if (IsVisible)
     {
         ((LancementCombatViewModel)DataContext).RechercherInvitations();
     }
 }
 private void UserControl_IsVisibleChanged(object sender, System.Windows.DependencyPropertyChangedEventArgs e)
 {
     if (IsVisible)
     {
         DiscordHelper.SetDiscordRPCStatus("CyberCAT Save Editor");
     }
 }
 private void CancelButton_IsVisibleChanged(object sender, System.Windows.DependencyPropertyChangedEventArgs e)
 {
     if ((bool)e.NewValue)
     {
         this.CancelButton.Focus();
     }
 }
示例#14
0
 /// <summary>
 /// Fires whenever the Data contex changes
 /// </summary>
 /// <param name="sender">the sender</param>
 /// <param name="e">the arguments <see cref="System.Windows.DependencyPropertyChangedEventArgs"/></param>
 private void OnDataContextChanged(object sender, System.Windows.DependencyPropertyChangedEventArgs e)
 {
     if (e.NewValue is IUpdateDownloaderInstallerViewModel viewModel)
     {
         viewModel.Behavior = this;
     }
 }
示例#15
0
 private void ItemEditor_DataContextChanged(object sender, System.Windows.DependencyPropertyChangedEventArgs e)
 {
     if (this.DataContext is ItemEditorViewModel vm)
     {
         vm.ViewportControl = viewport;
     }
 }
示例#16
0
 private void UserControl_DataContextChanged(object sender, System.Windows.DependencyPropertyChangedEventArgs e)
 {
     if (DataContext is ViewModels.MainWindowVM)
     {
         (DataContext as ViewModels.MainWindowVM).CurrentSession.LittleTimeRemaining += CurrentSession_LittleTimeRemaining;
     }
 }
示例#17
0
 private void AssociatedObject_IsVisibleChanged(object sender, System.Windows.DependencyPropertyChangedEventArgs e)
 {
     AssociatedObject.Dispatcher.BeginInvoke(new Action(() =>
     {
         Keyboard.Focus(AssociatedObject);
     }), System.Windows.Threading.DispatcherPriority.Render);
 }
示例#18
0
 void LineStatusControl_DataContextChanged(object sender, System.Windows.DependencyPropertyChangedEventArgs e)
 {
     if (this.DataContext != null && this.DataContext is ObservableCollection <StationTroubleStatus> )
     {
         UpdateStation(this.DataContext as ObservableCollection <StationTroubleStatus>, StationCount);
     }
 }
 private void GroupBox_IsVisibleChanged_2(object sender, System.Windows.DependencyPropertyChangedEventArgs e)
 {
     if (((Control)sender).IsVisible)
     {
         FreeTag.BackgroundFocus();
     }
 }
示例#20
0
 private void FieldMappingView_IsVisibleChanged(object sender, System.Windows.DependencyPropertyChangedEventArgs e)
 {
     if (Visibility == System.Windows.Visibility.Visible)
     {
         m_part.Warning = m_part.Warning;
     }
 }
 private async void OverlayItemControl_DataContextChanged(object sender, System.Windows.DependencyPropertyChangedEventArgs e)
 {
     if (this.IsLoaded && this.ViewModel != null)
     {
         await this.ViewModel.OnLoaded();
     }
 }
示例#22
0
        void EnumMenu_DataContextChanged(object sender, System.Windows.DependencyPropertyChangedEventArgs e)
        {
            if (!(DataContext is EnumSetting))
            {
                return;
            }

            EnumSetting ES = DataContext as EnumSetting;

            string[] values = ES.FriendlyOptions;
            int      count  = values.Length;

            if (count == 0)
            {
                return;
            }

            string friendlyValue = ES.FriendlyValue;

            for (int i = 0; i < count; i++)
            {
                MenuItem MI = new MenuItem()
                {
                    Header = values[i], IsChecked = friendlyValue == values[i]
                };
                MI.Click += MenuItem_Click;
                Items.Add(MI);
            }

            ES.ValueChanged += ES_ValueChanged;
        }
示例#23
0
 private void buttonPanel_IsVisibleChanged(object sender, System.Windows.DependencyPropertyChangedEventArgs e)
 {
     if (buttonPanel.IsVisible)
     {
         BringIntoView();
     }
 }
示例#24
0
 private void GraphTilesControl_DataContextChanged(object sender, System.Windows.DependencyPropertyChangedEventArgs e)
 {
     if (DataContext is GraphTilesVm dc)
     {
         dc.ImageSize = new TT.Sz2 <double>(TilesControl.ActualWidth, TilesControl.ActualHeight);
     }
 }
示例#25
0
 private void UserControl_IsVisibleChanged(object sender, System.Windows.DependencyPropertyChangedEventArgs e)
 {
     if (IsVisible)
     {
         // DiscordHelper.SetDiscordRPCStatus("BackStage - Recently Used");
     }
 }
 private void DataWindow_IsVisibleChanged(object sender, System.Windows.DependencyPropertyChangedEventArgs e)
 {
     if (IsVisible)
     {
         DiscordHelper.SetDiscordRPCStatus("Journal Editor");
     }
 }
 private void UserControl_IsVisibleChanged(object sender, System.Windows.DependencyPropertyChangedEventArgs e)
 {
     if (IsVisible)
     {
         DiscordHelper.SetDiscordRPCStatus("Setting - General");
     }
 }
 private void UserControl_IsVisibleChanged(object sender, System.Windows.DependencyPropertyChangedEventArgs e)
 {
     if (IsVisible)
     {
         ((InventaireViewModel)DataContext).Rechercher();
     }
 }
示例#29
0
 private void UserControl_IsVisibleChanged(object sender, System.Windows.DependencyPropertyChangedEventArgs e)
 {
     if (this.IsVisible)
     {
         DiscordRPCHelper.WhatAmIDoing("Radio Player");
     }
 }
示例#30
0
 private void lbNPCs_IsEnabledChanged(object sender, System.Windows.DependencyPropertyChangedEventArgs e)
 {
     if (!lbNPCs.IsEnabled)
     {
         lbNPCs.SelectedItem = null;
     }
 }