private void OkClick(object sender, RoutedEventArgs e) { bool valuesChanged = false; if (NewAspectRatio != 0) { DisplayInformationEx = new DisplayInformationEx(SizeHelpers.MakeSizeFromDiagonal(NewDiagonal, NewAspectRatio), SizeHelpers.MakeSize(NewWidth, NewAspectRatio)); valuesChanged = true; } Hide(valuesChanged); }
static DisplayInformationEx() { if (!DesignerProperties.IsInDesignTool) { Default = CreateForHardwareOrLegacyFallback(); return; } var size = SizeHelpers.MakeSizeFromDiagonal(DisplayConstants.BaselineDiagonalInInches15To9HighRes, DisplayConstants.AspectRatio15To9); var resolution = SizeHelpers.MakeSize(SizeHelpers.WxgaPhysicalResolution.Width, DisplayConstants.AspectRatio15To9); Default = new DisplayInformationEx(size, resolution, DisplayInformationSource.DesignTimeFallback); }
public async Task Update_product_size() { var product = await CreateValidProduct(); var repository = new ProductRepository(fixture.context); var sut = await repository.GetProductFullAsync(product.Id); Assert.True(await repository.ExistsAsync(product.Id)); Assert.NotNull(sut); var newSize = await SizeHelpers.CreateValidSize(); await UpdateProductSize(sut.Id, newSize); sut = await repository.LoadFullProductTrackedAsync(sut.Id); await fixture.context.Entry(sut).ReloadAsync(); Assert.Equal(newSize.Id, sut.Size.Id); }