i have to Give navigation in my application so i took one navigation window and other as page object.i provided windowstate="maximized" still it dont open in full screen.can anyone help me?
NavigationWindow
<NavigationWindow x:Class="SALIENT.View.Start"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Start" Source="../View/MainWindow" WindowState="Maximized">
Page
<Page x:Class="SALIENT.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Salient" >
If you want a full screen you need to set your "WindowStyle" property to none, try this:
<NavigationWindow x:Class="SALIENT.View.Start"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Start" Source="../View/MainWindow" WindowState="Maximized" WindowStyle="None>
Related
I write my app without using Shell. So I created my own Window using IDialogService and opened in one of my modules.
As far, as I am concerned, Region Manager is attached to Shell, but due to the fact I don't have it, region manager doesn't work when I try to navigate from one view to another.
I know that Region Navigation works fine with the shell (I tested it) and the same code stops working when I substitute the shell with IDialogService.
Here is what I have
<Window x:Class="TechDocs.Views.MainSettingsWindowView"
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:prism="http://prismlibrary.com/"
prism:ViewModelLocator.AutoWireViewModel="True"
mc:Ignorable="d"
Title="MainSettingsWindow" Height="400" Width="750">
<Grid>
</Grid>
</Window>
Content for the first region. When I click the button, it should navigate to the second region.
<UserControl x:Class="TechDocs.Views.SettingsView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:prism="http://prismlibrary.com/"
prism:ViewModelLocator.AutoWireViewModel="True"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<Button Command="{Binding NodeSelectedCommand}" Name="Button"/>
<ContentControl prism:RegionManager.RegionName="region"/>
</Grid>
</UserControl>
In module I connect my root window with UserControl which holds the button and Content control for the second region.
public class SettingsModule : IModule
{
protected override void RegisterTypes(IContainerRegistry containerRegistry)
{
var dialogService = _containerProvider.Resolve<IDialogService>();
containerRegistry.RegisterDialog<MainSettingsWindow>("MyWindow");
containerRegistry.RegisterDialog<SettingsView>("customView");
containerRegistry.RegisterForNavigation<MyView>();
dialogService.Show("customView");
}
}
And when I click the button I get in this code
public void SelectedNode()
{
regionManager.RequestNavigate("region", "MyView");
}
RequestNavigate doesn't give any exceptions, but still nothing appears on the screen.
Could you please explain how I should register region manager with my window?
Try to initialize the region manager explicitly in your custom window using the static methods below:
RegionManager.SetRegionName(cc, "region");
RegionManager.SetRegionManager(cc, regionManager);
XAML:
<ContentControl x:Name="cc" prism:RegionManager.RegionName="region"/>
I am new to WPF. I create a new project in wpf and in mainwindow.xaml I wrote following
<Window x:Class="WpfApp1.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:WpfApp1"
mc:Ignorable="d"
Title="MainWindow" Height="350" Width="604" WindowStartupLocation="CenterScreen" WindowState="Maximized" IsTabStop="False" Focusable="False">
<StackPanel>
<TextBlock Text = "Welcome to XAML Tutorial with VB.net" Height = "20" Width = "220" Margin = "5"/>
<Button Content = "Ok" Height = "20" Width = "60" Margin = "5"/>
</StackPanel>
when i run the window a panel automatically opens at the top as following
How to hide this? Please help me.
Generally go to the main menu of VS and open the Debug menu. Select Debug | Options. This will open the debugger options dialog. Under the Debugging section select Hot Reload. Then, in the right view, spot the WPF and UWP section and uncheck the Enable in-app toolbar checkbox. Click OK to leave the dialog.
This is a debugging feature, quite useful at times.
To disable it, uncheck the Enable XAML Hot Reload under Tools -> Options.
I have the following MainPage.xaml:
<Page
x:Class="ComponentGuidTestUW8.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:ComponentGuidTestUW8"
xmlns:controls="using:ZeroProximity.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<controls:Accordion>
<controls:AccordionItem Header="Heading 1">
<controls:AccordionItem.Content>
<TextBlock Text="Texting"/>
</controls:AccordionItem.Content>
</controls:AccordionItem>
</controls:Accordion>
</Grid>
The page does display the Accordion control properly when I run the app but I am getting the following error when I try to design xaml file in VS 2015:
"COMException: Error HRESULT E_FAIL has been returned from a call to a
COM component."
Desing Tab
How do I fix that?
Looks like this is an issue with the control: have you try to contact the author ?
I have inheritted Button and am trying to add it to my main window.
It doesn't show up in the Toolbox. I have tried rebuilding several times.
I have tried adding xmlns:dc="clr-namespace:123Letters and xmlns:dc="clr-namespace:123Letters;assembly=123Letters to my MainWindow.
My MainWindow is:
<Window x:Class="MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Name="MainWin"
Title="123 Letters">
</Window>
My WeatherStationButton is:
<Button x:Class="WeatherStationButton"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<Grid>
</Grid>
</Button>
and
Public Class WeatherStationButton
Inherits Button
Public Property WeatherStation As tblWeather
End Class
This is super simple stuff. I believe it's because XAML doesn't allow numbers in the first part of namespaces, but I can not find any reference to that anywhere, so I am asking if I am doing something wrong or is this one of XAML's "features"?
Just realized I could add my answer.
If your project name is 123Letters, you need to add an underscore before the first number when referencing it in XAML like, _123Letters.
Your clr-namespace declaration would then be:
xmlns:dc="clr-namespace:_123Letters"
and you could add your inherited button to your MainWindow like this:
<dc:WeatherStationButton x:Name="btnWS" />
I'm developing a WPF application with VB2010 and expression blend4.
This application is mainly intended to be used through touch user input.
I don't know when and why but all UI_ELEMENTs have lost default touch responsiveness, for example the button click event doesn't rise anymore the click event when touched, the Slider element doesn't slide, and so on.
I'm using framework 4.0
I post the xaml header:
<Window
xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:my="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero" xmlns:my1="clr-namespace:WpfApplication1" xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions" xmlns:ee="http://schemas.microsoft.com/expression/2010/effects" xmlns:DataStore="clr-namespace:WpfApplication1.Expression.Blend.DataStore.DataStore" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:ec="http://schemas.microsoft.com/expression/2010/controls" xmlns:Microsoft_Samples_Kinect_WpfViewers="clr-namespace:Microsoft.Samples.Kinect.WpfViewers;assembly=Microsoft.Samples.Kinect.WpfViewers" xmlns:ed="http://schemas.microsoft.com/expression/2010/drawing" mc:Ignorable="d" x:Class="MainWindow"
Any help is welcome.