/// <summary> /// Edit the adjustment. /// </summary> /// <param name="adjustment"> The adjustment. </param> public void AdjustmentMenuEdit(IAdjustment adjustment) { if (adjustment is null) { this.DrawLayout.Hide(); return; } if (adjustment.PageVisibility == Visibility.Collapsed) { this.DrawLayout.Hide(); return; } { this.AdjustmentFlyout.Hide(); this.LayerFlyout.Hide(); } IAdjustmentPage adjustmentPage = Retouch_Photo2.Adjustments.XML.CreateAdjustmentPage(typeof(BrightnessPage), adjustment.Type); if (this.SelectionViewModel.SelectionLayerage is Layerage layerage) { ILayer layer = layerage.Self; int index = layer.Filter.Adjustments.IndexOf(adjustment); adjustmentPage.Index = index; adjustmentPage.Follow(); } this.DrawLayout.ShowWritable(adjustmentPage.Icon, adjustmentPage.Title, adjustmentPage.Self); // Delegat }
public object Convert(object value, Type targetType, object parameter, string culture) { if (value is AdjustmentType type) { IAdjustmentPage adjustmentPage = Retouch_Photo2.Adjustments.XML.CreateAdjustmentPage(typeof(BrightnessPage), type); return(adjustmentPage.Icon); } return(null); }