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.
Related
I have this xaml on a project that uses Caliburn micro :
<Window x:Class="Myproject.MainWindowView"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
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:cal="http://www.caliburnproject.org"
mc:Ignorable="d" d:DesignHeight="800" d:DesignWidth="1024" WindowStyle="None" Background="Black" >
</Window>
but when I run the application, I have a white line at the top of window :
How can I remove the line at the top?
I need a window that has no title bar, but should be resizable.
Well for the sake of easy points I suppose, the window chrome is built into the style templates and still inherited when you define WindowStyle="None" but still allow re-sizing to allow a hit spot for the manipulation event to occur. So like described in another answer you can take control of the base template and edit it to your requirements while still retaining the ability for the user to have point to invoke the re-sizing ability but with the frame thickness set to 0.
Hope this helps, cheers!
I want to create a metro style application, I did some researches and I found lots of articles and tutorials about that.
But I still need a clear comparison between Modern UI for WPF , Elysium and MahApps.
Testing all of them takes too much time ! I need to learn bout each one's features to decide with which one to start.
Thanks,
first : Download the WPF Shell Integration Library Here
then use this XML Code :
<Window x:Class="MyLibrary.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:shell="http://schemas.microsoft.com/winfx/2006/xaml/presentation/shell"
Title="MainWindow"
WindowStyle="SingleBorderWindow"
ResizeMode="CanResizeWithGrip"
mc:Ignorable="d"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="449"
d:DesignWidth="677"
Foreground="White"
removed="Black">
<shell:WindowChrome.WindowChrome>
<shell:WindowChrome CaptionHeight="35"
GlassFrameThickness="0,0,0,1"
ResizeBorderThickness="5" />
</shell:WindowChrome.WindowChrome>
<Grid x:Name="LayoutRoot">
</Grid>
</Window>
(note, you need to have referenced Microsoft.Windows.Shell)
This is really the Best way to do that.. It will work on all windows versions.
Edit:
if you want to add Caption Buttons on the top of the window add this XAML code to any control at the top: (button as example)
<button shell:WindowChrome.IsHitTestVisibleInChrome="True"/>
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.
I'd like to get the default text in a combo box to show "Select Team...."
Like this in WPF
Setting default text for a combo box
But in sketchflow.
How can I do this?
Thanks
it is a sliverlight project. my xaml reads:
<UserControl
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"
mc:Ignorable="d"
x:Class="SchoolsLoginScreens.Screen_2"
Width="640" Height="480">
<Grid x:Name="LayoutRoot" Background="White">
<ComboBox Height="61.256" Width="136.569" IsEditable="True" IsReadOnly="True" Text="-- Select Team --"/>
</Grid>
It says that IsEditable does not have a setter. But this appears to work in WPF project like the examples above.
SketchFlow projects are WPF or SL projects (depending what you chose when you created the project) so any answers you find for WPF/SL should apply.
I had the same question and found this to help me. Essentially, you just have to add at least one item to the combo box (right-click, add ComboBoxItem) then look at the Common properties while the control is selected and you will see a field called "SelectIndex" that is currently set to -1. Just change this to 0 to select the first item in your list.
for a long time i am looking for trick to develop a Blu like window where some leaf image is coming out from title bar. how they design such layout.
here is small image of custom title bar
please some one tell me how could i design this type of title bar where something coming out from title bar.
You can achieve this by setting an appropriate background image for the window and setting AllowsTransparency to True:
<Window x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" WindowStyle="None" AllowsTransparency="True">
<Window.Background>
<ImageBrush ImageSource="/bg.png"/>
</Window.Background>
Then you have to create your own title bar, because the default one will not be displayed.