Giter Site home page Giter Site logo

Comments (7)

 avatar commented on May 5, 2024

Provide a full code sample for me to look at

from mahapps.metro.

dlebedynskyi avatar dlebedynskyi commented on May 5, 2024

Сode is below.

<metro:MetroWindow x:Class="ScannerAndIndexing.Views.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:metro="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
        xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
        xmlns:Behaviours="clr-namespace:MahApps.Metro.Behaviours;assembly=MahApps.Metro"
        WindowStartupLocation="CenterScreen"
        Title="Document Scanner"
        Width="1024" Height="800"
        SourceInitialized="Window_SourceInitialized"
        DataContext="{Binding Main, Source={StaticResource Locator}}">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="../Resources/Icons.xaml"/>
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colours.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.AnimatedSingleRowTabControl.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Blue.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseLight.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>

    </Window.Resources>
    <metro:MetroWindow.WindowCommands>
        <metro:WindowCommands>
            <Button Content="settings"  Click="btnSelectSource_Click"/>
            <Button Content="about" />
        </metro:WindowCommands>
    </metro:MetroWindow.WindowCommands>
    <!--<i:Interaction.Behaviors>
        <Behaviours:BorderlessWindowBehavior ResizeWithGrip="True"/>

    </i:Interaction.Behaviors>-->
    <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="10"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="50*"/>
            <ColumnDefinition Width="5"/>
            <ColumnDefinition Width="50*"/>
        </Grid.ColumnDefinitions>

        <DockPanel LastChildFill="True" Grid.Row="0">
            <TabControl>
                <TabItem Header="_Open or Scan">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <StackPanel Orientation="Horizontal" >
                            <metro:AppBarButton  Command="{Binding OpenDocumentCommand}"
                                    Height="55"
                                    Width="55"
                                    VerticalAlignment="Top" Content="Open" MetroImageSource="{StaticResource appbar_folder_open}">
                            </metro:AppBarButton>
                            <metro:AppBarButton  Command="{Binding ScanBatchCommand}"
                                    Height="55"
                                    Width="55"
                                    VerticalAlignment="Top" Content="Scan" MetroImageSource="{StaticResource appbar_barcode}">
                            </metro:AppBarButton>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal"  Width="Auto" Grid.Column="2">
                            <metro:AppBarButton
                                    Height="55"
                                    Width="55"
                                    Foreground="{DynamicResource AccentColorBrush}"
                              IsEnabled="{Binding IsPreviousPageAvalieble, Mode=OneWay}" MetroImageSource="{StaticResource appbar_navigate_previous}"
                            Command="{Binding PreviousPageCommand}" />
                            <metro:AppBarButton Height="55"
                                    Width="55"
                                    Foreground="{DynamicResource AccentColorBrush}"
                              IsEnabled="{Binding IsNextPageAvalieble, Mode=OneWay}" MetroImageSource="{StaticResource appbar_navigate_next}"
                            Command="{Binding NextPageCommand}"/>
                        </StackPanel>
                    </Grid>
                </TabItem>
                <TabItem Header="_Edit"></TabItem>
            </TabControl>
        </DockPanel>
        <DockPanel LastChildFill="true" Grid.Column="0" Grid.Row="1">

        </DockPanel>
        <DockPanel LastChildFill="True" Grid.Row="0" Grid.Column="2" Grid.RowSpan="2"  Background="White">
            <WebBrowser DockPanel.Dock="Right" x:Name="webBrowser"></WebBrowser>
        </DockPanel>
    </Grid>
</metro:MetroWindow>

from mahapps.metro.

dlebedynskyi avatar dlebedynskyi commented on May 5, 2024

web browser content doesn't maters.

from mahapps.metro.

 avatar commented on May 5, 2024

I can't replicate the issue. Using that example (and turning on gridlines, removing bits that won't compile...)

I get that. You need to consider that WebBrowser control in WPF is actually a WindowsForms/ActiveX control and has "airspace" issues (that is, webbrowser is always on top, isn't always part of the WPF rendering cycle). It's possible that animations like the "slide in on load" of MetroWindow is causing issues.
If this is the issue you're experiencing, you may need to consider Awesomium or CefSharp which use Chromium as a true WPF control and don't suffer from such airspace issues.

from mahapps.metro.

dlebedynskyi avatar dlebedynskyi commented on May 5, 2024

Thank you very much for the link. Will look at it.
Strange that you couldn't reproduce and it's my mistake forgot to remove all references and bits in code. Was in a hurry.
In any case, just as alternative, is there some way to switch off animations on MetroWindow loading? like "slide in on load" and others ?

from mahapps.metro.

 avatar commented on May 5, 2024

You can look at rolling your own window rather than using MetroWindow

from mahapps.metro.

mikedavies-dev avatar mikedavies-dev commented on May 5, 2024

I know this report is old but I get the same thing with v1.1.2.0.

With a WebBrowser in a Grid cell the WebBrowser has a gap beside it. If I resize the window or even hover over the max/min buttons the gap goes away.

Setting WindowTransitionsEnabled to false fixes the problem.

Example XAML

<Controls:MetroWindow 
    x:Class="testApp.win.app.MainWindow"
    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:testApp.win.app"
    xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
    mc:Ignorable="d"
    Title="SomeWindow" 
    Height="600" 
    Width="1024"
    >
    <Grid Margin="5">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="250" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>

        <Border 
            Grid.Column="0" 
            HorizontalAlignment="Stretch" 
            BorderBrush="Black" 
            BorderThickness="0"
            Background="Green"
            >
            <StackPanel >
                <TextBlock>
                    This is some text
                </TextBlock>
            </StackPanel>
        </Border>

        <Border 
            Grid.Column="1"
            HorizontalAlignment="Stretch"
            VerticalAlignment="Stretch"
            BorderBrush="Black" 
            BorderThickness="0"
            >
            <WebBrowser 
                Name="TvBrowser"
                HorizontalAlignment="Stretch"
                VerticalAlignment="Stretch"
                >
            </WebBrowser>
        </Border>
    </Grid>
</Controls:MetroWindow>

from mahapps.metro.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.