B
B
Boris the Animal2015-06-22 08:32:33
.NET
Boris the Animal, 2015-06-22 08:32:33

The non-standard window expands to full screen. That is, closing the taskbar. How to fix?

Here is the code.

<windows:WindowBase x:Class="Dispatcher.Windows.View.MainWindow"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:behaviors="clr-namespace:BSU.UI.Base.Behaviors;assembly=BSU.UI.Base"
                    xmlns:windows="clr-namespace:BSU.UI.Base.Windows;assembly=BSU.UI.Base"
                    xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
                    Title="{Binding Title}"
                    Width="1280"
                    Height="800"
                    MinWidth="920"
                    MinHeight="600"
                    DataContext="{Binding Source={StaticResource Locator},
                                          Path=Main}"
                    Language="RU"
                    Style="{StaticResource DialogWindowStyle}"
                    TextOptions.TextFormattingMode="Ideal"
                    TextOptions.TextRenderingMode="ClearType"
                    WindowStartupLocation="CenterScreen"
                    WindowState="Maximized">
</windows:WindowBase>

<Style x:Key="DialogWindowStyle"
           TargetType="{x:Type Window}">
      <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}" />
      <Setter Property="Background" Value="#02FFFFFF" />
      <Setter Property="AllowsTransparency" Value="True" />
      <Setter Property="ResizeMode" Value="CanResizeWithGrip" />
      <Setter Property="WindowStyle" Value="None" />
      <Setter Property="SizeToContent" Value="Manual" />
      <Setter Property="FontSize" Value="14" />
      <Setter Property="Margin" Value="0" />
      <!--  <Setter Property="FontFamily" Value="Microsoft Sans Serif" />  -->
      <!--  <Setter Property="FontFamily" Value="Arial" />  -->
      <!--  <Setter Property="Effect" Value="{StaticResource WindowDropShadowEffectKey}" />  -->
      <Setter Property="Template">
         <Setter.Value>
            <ControlTemplate TargetType="{x:Type Window}">
               <Border Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}">
                  <AdornerDecorator>
                     <ContentPresenter />
                  </AdornerDecorator>
               </Border>
            </ControlTemplate>
         </Setter.Value>
      </Setter>

      <Style.Triggers>
         <Trigger Property="ResizeMode" Value="CanResizeWithGrip">
            <Setter Property="Template" Value="{StaticResource WindowTemplateKey}" />
         </Trigger>

      </Style.Triggers>
   </Style>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
AxisPod, 2015-06-22
@AxisPod

Well, here you need to make a class, there was an article on Habré not so long ago, look how it’s done there, you need to manually process the SystemParameters.WorkArea work area.
habrahabr.ru/post/158561

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question