xaml

Can you add items to a context menu in a parents menu?

or conversly can you import a parents menu items into a child window? So I have an UI that is composed of controls that all have their own context menu, but we also have a datagrid that get's nested inside our generic contaier. So when you right click the datagrid elements I want to show both the context items I've created for the da...

How can I load a WPF (xaml) window inside of another WPF windows in a Panel?

Is this possible? I used a Frame control and: show(ex:showwindow.xaml) But I get this error: root element is not valid for navigation ...

Error - Cannot find static resource in a WPF application

I'm learning WPF and started with this MSDN tutorial. I was just following the tutorial. When I finished the code as per the tutorial and try to run I get an exception in a XAML page which says "'Provide value on 'System.Windows.StaticResourceExtension' threw an exception.' Line number '27' and line position '55'." . And inner exception...

WPF custom control problem

I have a problem, and I have not found the solution yet. I woud like to create a base custom control and use it in another custom control. The base control works fine when I use it in a window, but when I use it in the other custom control, the binding does not work. What's wrong with my code? Code: Model: public class ElementModel {...

Can't access resource from Generic.xaml within the Custom Control constructor.

I'm not sure why this is doing this, but I can't access the resource from within my constructor. XTabItem.cs using System; using System.ComponentModel; using System.Windows; using System.Windows.Controls; using System.Windows.Media; namespace MyStuff { public class XTabItem : TabItem { public static readonly Dependency...

WPF binding behaviour different when bound property is declared as interface vs class type?

This started with weird behaviour that I thought was tied to my implementation of ToString(), and I asked this question: http://stackoverflow.com/questions/2916068/why-wont-wpf-databindings-show-text-when-tostring-has-a-collaborating-object It turns out to have nothing to do with collaborators and is reproducible. When I bind Label.Con...

Animate UserControl (When It Gets Collapsed) in WPF

I have two xaml file one is MainWindow.xaml and other is userControl EditTaskView.xaml. In MainWindow.xaml it consists of listbox and when double clicked any item of listbox, it displays edit window (EditView userControl). Whenever edit window gets displayed, it plays an animation (sliding from right to left). The EditView userControl ha...

WPF: how to define collections for use in xaml

I want to define something like this <myCustomControl> <myCustomControl.Images> <Image Source="{StaticResource LockedIcon16}" /> <Image Source="{StaticResource UnlockedIcon16}"/> <myCustomControl.Images> <myCustomControl/> what property definitions do i need to get that collection (Images) happening? ...

Get values from *.resx files in XAML

Is it possible to add some value from resource file right into the XAML markup? Or for localization we always have to make something like this in *.cs file: txtMessage.Text = Messages.WarningUserMessage; Where Messages is resource, and txtMessage is TextBlock. ...

Generic usercontrol possible?

Since .Net 4 does support generics in XAML, I'd like to create a UserControl using generics, like: public class MyComboBox<T> { } I can declare the UserControl quite well, but how would I use it in a XAML file? Or can't this be done in XAML? ...

Silverlight - displaying graphical resources within a button

Has anyone solved this: displaying graphical resources within a button create a resource, for instance a rectangle <UserControl.Resources> <Rectangle x:Key="myRectangle" Fill="Red" Height="100" Width="100"/> </UserControl.Resources> then set the content of the button to the resource <Button Content="{StaticResource myRectangle}...

WPF Control Templating: Keeping Windows look and feel

I'm working on a control template for an inherited TextBox class. I'd like to use this template to add additional controls with the ScrollViewer. I can achieve that goal just fine, what I can't do recreate the border in such away that it matches the Windows look and feel. I have Windows Classic as my theme on XP. Textboxes are typicall...

Add animation when user control get visible and collapsed In Wpf

I have two xaml files MainWindow.xaml and other user control WorkDetail.xaml file. MainWindow.xaml file has a textbox, button, listbox and reference to WorkDetail.xaml(user control which is collapsed). Whenever user enter any text, it gets added in listbox when the add button is clicked. When any items from the listbox is double clicked,...

WPF - 'Relational' Data in XAML Using DataContext

Hi, Say I have a list of Employee IDs from one data source and a separate data source with a list of Employees, with their ID, Surname, FirstName, etc. Is it possible in XAML only to get the Employee's name from the second data source and display it next to the ID, using something like this (with the syntax corrected)?.. <TextBlock x:...

Why does nothing in WPF have a click event?

This seems very strange to me. I know through some adventurous inheritance you can convert most UIElements to a button, but it is a cumbersome way of implementing the most basic of of computer events ...

WPF DataBinding to standard CLR properties in code-behind

Hi everyone, Just learning WPF databinding and have a gap in my understanding. I've seen a few similar questions on StackOverflow, but I'm still struggling in determining what I have done wrong. I have a simple Person class with a Firstname and Surname property (standard CLR properties). I also have a standard CLR property on my Window ...

silverlight master-detail with two listboxes in pure xaml with ria services throwing exception

Hi, I was trying to achieve master-detail with 2 ListBox, 2 DomainDataSource and a IValueConverter, when entering the page it throws the random error it does when your xaml is invalid: "AG_E_PARSER_BAD_PROPERTY_VALUE [Line: 24 Position: 61]" Which is in fact the start position of where I am binding the listbox selected item with convert...

WPF application in a one window

I would like to make an application in a one window using XAML. It should be like a slideshow with next and back button. One idea is to make 4 panels and have just one enable at the time. Is there any other way to do this? Like dynamic loading of other XAML? is it the BackgroundWorker mandatory to use with WPF (hence is DirectX rendered...

want to create a listbox with a textblock and a button itemtemplate

I want to create a listbox like the one shown in the image, i just dont know how will i get the button(the red close button) click event for each item in the listbox Can anyone point me to a good tutorial on this Thanks ...

Zoom to specified mesh

Say we have 3 mesh in the viewport3d and one camera. If I select mesh 1 I want the camera to zoom to the specified mesh? ...