Le problème est la frontière est trop épaisse pour Windows 10.WindowChrome - trop épaisse bordure pour Windows 10
Si vous ne voyez pas la capture d'écran ci-dessous, alors voici le texte:
- Cette frontière est trop épais à gauche, à droite et en bas
- Border est plus lumineux aussi les bords
Comment faire une bordure 1px comme Google Chrome (ou l'Explorateur Windows 10) a? Le négatif 1px ne fonctionne pas bien, il rend la bordure blanche et reste épaisse.
Frameworkest .NET Framework 4.6.2.
code:
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:AnotherOffice"
xmlns:System="clr-namespace:System;assembly=mscorlib" x:Name="window" x:Class="AnotherOffice.MainWindow"
mc:Ignorable="d"
Title="AnotherOffice Text v0.0.1 - New document" Height="720" Width="1280" Background="{x:Null}" WindowState="Maximized" Margin="0" BorderThickness="8">
<Window.Style>
<Style TargetType="{x:Type Window}">
<Setter Property="WindowChrome.WindowChrome">
<Setter.Value>
<WindowChrome
GlassFrameThickness="8,40,8,8"
ResizeBorderThickness="2"
CornerRadius="0"
CaptionHeight="32"
UseAeroCaptionButtons="True"
/>
</Setter.Value>
</Setter>
</Style>
</Window.Style>
<local:AnotherOfficeTextBase Margin="0,32,0,0"/>
</Window>
UPD: J'ai essayé d'utiliser ce code:
if (SystemParameters.IsGlassEnabled)
{
WindowChrome winChrome = new WindowChrome();
winChrome.CaptionHeight = 32;
winChrome.CornerRadius = new CornerRadius(0);
winChrome.GlassFrameThickness = new Thickness(8, 32, 8, 8);
winChrome.ResizeBorderThickness = new Thickness(1);
winChrome.UseAeroCaptionButtons = true;
WindowChrome.SetWindowChrome(this, winChrome);
InitializeComponent();
} else
{
MainWindowNoGlass fallback = new MainWindowNoGlass();
fallback.Show();
Close();
}
Et ... aucun effet.
J'utilise juste le style de fenêtre Mah.Apps (même si je n'utilise plus leur style Metro Interface). Ensuite, je sais que cela sera cohérent entre les systèmes d'exploitation et que j'aurai plus de contrôle sur tous les éléments. – Joe
@Joe Je voudrais utiliser ma propre solution parce que je veux avoir un TabControl dans ma fenêtre chrome. Des idées? – ArtyomIsFlash
Ah, bien sûr. Je voudrais jeter un oeil à leur code BorderlessWindowBehavior puis https://github.com/MahApps/MahApps.Metro/blob/fd47b9ff616febc36c86a6b332578e011f181ce3/MahApps.Metro/Behaviours/BorderlessWindowBehavior.cs. – Joe