public void Create_ShouldCreateTheCorrectSizeLocation(DescriptorBase descriptorBase, string retentionKey, ResizeMode mode, SizeToContent sizeToContent, Size width, Size height) { IWindowSizeLocation windowSizeLocation = WindowSizeLocationFactory.Create(descriptorBase); Assert.AreEqual(retentionKey, windowSizeLocation.RetentionKey); Assert.AreEqual(mode, windowSizeLocation.ResizeMode); Assert.AreEqual(sizeToContent, windowSizeLocation.SizeToContent); Assert.AreEqual(width, windowSizeLocation.Width); Assert.AreEqual(height, windowSizeLocation.Height); }
private void SetWindowSizeLocation(IWindowSizeLocation windowSizeLocation) { ResizeMode = windowSizeLocation.ResizeMode; SizeToContent = windowSizeLocation.SizeToContent; Width = windowSizeLocation.Width.Value; MinWidth = windowSizeLocation.Width.Min; MaxWidth = windowSizeLocation.Width.Max; Height = windowSizeLocation.Height.Value; MinHeight = windowSizeLocation.Height.Min; MaxHeight = windowSizeLocation.Height.Max; }
public ElementWindow(IElementConfiguration appenderConfiguration, IElementDefinition propertyDefinition, IWindowSizeLocation windowSizeLocation, ISaveStrategy saveStrategy) : base(windowSizeLocation.RetentionKey) { InitializeComponent(); DataContext = this; mMessageBoxService = new MessageBoxService(this); mConfiguration = appenderConfiguration; mSaveStrategy = saveStrategy; SetWindowSizeLocation(windowSizeLocation); PropertyDefinition = propertyDefinition; PropertyDefinition.MessageBoxService = mMessageBoxService; Loaded += WindowOnLoaded; Icon = new BitmapImage(new Uri(PropertyDefinition.Icon)); }
public ElementWindow(IElementConfiguration appenderConfiguration, IElementDefinition propertyDefinition, IWindowSizeLocation windowSizeLocation, ISaveStrategy saveStrategy) : base(windowSizeLocation.RetentionKey) { InitializeComponent(); DataContext = this; mMessageBoxService = new MessageBoxService(this); mConfiguration = appenderConfiguration; WindowSizeLocation = windowSizeLocation; mSaveStrategy = saveStrategy; SetWindowSizeLocation(windowSizeLocation); PropertyDefinition = propertyDefinition; PropertyDefinition.MessageBoxService = mMessageBoxService; Properties = new ObservableCollection <IProperty>(); Loaded += WindowOnLoaded; ((INotifyCollectionChanged)PropertyDefinition.Properties).CollectionChanged += PropertiesOnCollectionChanged; Icon = new BitmapImage(new Uri(PropertyDefinition.Icon)); }