123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- using InABox.DynamicGrid;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Input;
- namespace InABox.WPF
- {
- public class ObjectToGridLengthConverter : AbstractConverter<FrameworkElement?, GridLength>
- {
- public GridLength NotNull { get; set; } = new GridLength(0, GridUnitType.Pixel);
- public GridLength IsNull { get; set; } = new GridLength(1, GridUnitType.Auto);
-
- public override GridLength Convert(FrameworkElement? value)
- {
- return value == null
- ? IsNull
- : NotNull;
- }
- }
-
- public class ObjectToVisibilityConverter : AbstractConverter<FrameworkElement?, Visibility>
- {
- public Visibility NotNull { get; set; } = Visibility.Visible;
- public Visibility IsNull { get; set; } = Visibility.Collapsed;
-
- public override Visibility Convert(FrameworkElement? value)
- {
- return value == null
- ? IsNull
- : NotNull;
- }
- }
-
- public partial class Generic : ResourceDictionary
- {
- public Generic()
- {
- //InitializeComponent();
- }
- private void Panel_OnPreviewMouseRightButtonUp(object sender, MouseButtonEventArgs e)
- {
- var parent = (sender as FrameworkElement)?.TemplatedParent as DynamicTabItem;
- if (parent == null)
- return;
- parent.ContextMenuCommand.Execute(null);
- }
- }
- }
|