How to use Ignorable="d" - wpf

I want to make my usercontrol with yellow background while designing. After design it should stay transparent.
I've tried to use the "Ignore" flag but could not catch how it works.
<UserControl x:Class="Abnehmen_Standard.ucRoundButton"
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"
d:DesignHeight="84" d:DesignWidth="84"
d:Background="Yellow"
Last row does not work.
Can you advice me?

This will work if you are using Expression blend. As you can see in your mark up
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
"d" is used only for expression blend not for visual studio.
Look at this article if you want to do the same for visual studio, you will have to do some coding for this.

Related

How to set title of DXRibbonWindow in its center

I'm using DXRibbonwindow like this:
<dxr:DXRibbonWindow x:Class="MyNameSpace.MyRibbonWindow"
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:dxn="http://schemas.devexpress.com/winfx/2008/xaml/navbar"
xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
xmlns:dxd="http://schemas.devexpress.com/winfx/2008/xaml/docking"
xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
xmlns:dxr="http://schemas.devexpress.com/winfx/2008/xaml/ribbon"
xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"
SnapsToDevicePixels="True"
WindowStartupLocation="CenterScreen" WindowState="Maximized"
Title="title">
<Grid>
...
</Grid>
</dxr:DXRibbonWindow>
I want the title to be in the middle of the window's titlebar, but it doesn't, how can i make it? I'm using DevExpress 14.2.5 .
Override default control template using Visual Studio Blend or like it's explained here
I would recommend to use Blend see an example and the difference blend and VS editors
This problem occured in version 14.5 of DEVExpress, I upgrade its version to the newest 17.1 then the problem has been solved, thanks for the DevExpress developer.

Strange strip at the top of Windows 10 (wpf)

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!

WPF DesignData not working

I have a MVVM WPF application with a simple ListView. The ViewModel currently just contains a List property. I added a DesignData/SampleData.xaml file, set its Build Action to "DesignData" and referenced it in the Window's XAML code
<Window x:Class="..."
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:local="..."
mc:Ignorable="d"
Title="MainWindow" Height="483" Width="932">
<Grid d:DataContext="{d:DesignData Source=./DesignData/SampleData.xaml}">
But nothing shows up in the designer and VS2010 just gives me the following warning:
The file './DesignData/SampleData.xaml' is not part of the project or its 'Build Action' is not set to 'Resource'.
No matter what the "Build Action" it still gives me the same warning.
SampleData.xaml:
<MainWindowViewModel xmlns="clr-namespace:..."
xmlns:local="clr-namespace:...">
<MainWindowViewModel.Orders>
<local:Order OrderId="1000654321"/>
</MainWindowViewModel.Orders>
</MainWindowViewModel>
Any ideas on how to fix that?
Edit:
Project structure
The DesignData path is wrong as I thought it was relative to the solution/project whereas it seems it is relative to the containing XAML file.

WPF application lost touch capabilities

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.

Inconsistency between XAML intellisense and compiler for a control

I am converting some Silverlight XAML into WPF. I currently have a user control (MyControl) that is trying to include a couple of other controls that are custom buttons (MyButton1) that are within the same assembly. I have the following XAML that compiles and works in SL:
MyButton1
<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="MyCompany.MyNamespace.MySubnamespace.MyButton1"
d:DesignWidth="640" d:DesignHeight="480">
...
</UserControl>
MyControl
<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"
xmlns:somename="clr-namespace:MyCompany.MyNamespace.MySubnamespace;assembly=MyCompany.MyAssemblyName"
mc:Ignorable="d"
x:Class="MyCompany.MyNamespace.MySubnamespace.MyControl"
d:DesignWidth="640" d:DesignHeight="480">
<somename:MyButton1 />
</UserControl>
When I try to compile this code in WPF, I get the following error:
The tag 'MyButton1' does not exist in XML namespace 'clr-namespace:MyCompany.MyNamespace.MySubnamespace;assembly=MyCompany.MyAssemblyName.'
The weird thing is, if I comment out the <somename:MyButton1 /> line of code and compile and then type in <somename: IntelliSense gives me the option to autocomplete MyButton1. Which suggests that the control itself is in the assembly but for some reason it is not being seen when the MyControl XAML is being compiled.
For some context, I took the SL csproj file and made some modifications to it manually to make it a WPF csproj file. If there is a possibility that this caused this funkiness to happen, I'd be glad to share relevant portions of the project file.
Found the answer on an MSDN forum. Turns out that the assembly=MyCompany.MyAssemblyName line in my xmlns was screwing things up. Once I removed that line, I was able to reference the controls.
Related Link: http://social.msdn.microsoft.com/Forums/en/wpf/thread/807c9b80-81c7-4f75-aa2f-8427e17b1a90
To reference the current assembly you must not type its name but leave it blank, i.e. assembly=, the other option is of course to drop it completely. (MSDN -> Mapping to Current Assemblies)

Resources