コード例 #1
0
        private static void GroupDataChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            LayerGroupControl control = (LayerGroupControl)d;

            control.GeneratePreviewImage();
            foreach (var layer in control.LayersViewModel.Owner.BitmapManager.ActiveDocument.Layers)
            {
                layer.IsVisible = layer.IsVisible;
            }
        }
コード例 #2
0
        private static void LayersViewModelCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            LayerGroupControl control = (LayerGroupControl)d;

            if (e.OldValue is LayersViewModel oldVm && oldVm != e.NewValue)
            {
                oldVm.Owner.BitmapManager.MouseController.StoppedRecordingChanges -= control.MouseController_StoppedRecordingChanges;
            }

            if (e.NewValue is LayersViewModel vm)
            {
                vm.Owner.BitmapManager.MouseController.StoppedRecordingChanges += control.MouseController_StoppedRecordingChanges;
            }
        }