Comments (7)
Provide a full code sample for me to look at
from mahapps.metro.
С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.
web browser content doesn't maters.
from mahapps.metro.
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.
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.
You can look at rolling your own window rather than using MetroWindow
from mahapps.metro.
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)
- SaveWindowPosition not working when window is maximized on second screen with WindowState="Maximized" HOT 2
- Problem with MahApps.Styles.Slider style causes TestStack.White AutomationException
- It"s not a bug, I need some help to start !
- Unable to use Automation Peer on controls using Mahapps framework HOT 3
- Missing PART in the datagrid HOT 6
- Flyout overlapping to Menubar within the animation HOT 2
- Xaml warning: Resource '{x:Type MahApps.Metro.Controls.MetroWindow}' is not found HOT 4
- MultiSelectionComboBox / MultiSelectorHelper.SelectedItems one step behind
- The HamburgerMenu control uses the HamburgerMenuListBox control to show the menu items. You can use a DataTemplate with an Expander control with an HamburgerMenuListBox control as the Child to show submenu items:
- Add Filter Buttons in DataGridColumn Headers HOT 1
- MultiSelectorHelper.SelectedItems throws Exception when an Item is selected from a ListBox which is nested inside a ListView
- RoutedEventArgs is empty
- mahapps.metro is missing NuGet package README file
- Detected package version outside of dependency constraint: MahApps.Metro 2.4.10 requires ControlzEx (>= 4.4.0 && < 6.0.0) but version ControlzEx 6.0.0 was resolved. HOT 1
- Colon between Hour/Minute in TimePicker when PickerVisibility is set to Minute,Second
- Bindings are broken in SplitView
- The value of the ValueProperty of NumericUpDown gets lost during navigation
- 1NNAP4ZYwn63KHZXG5vPaP26W3ixdFSw45 #95943
- RichTextBox and Themes HOT 3
- MetroWindow : Unloaded event HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mahapps.metro.