xaml

Make an UI element transparent to mouse events

I have a lot of UI elements placed inside a canvas. Some of them are not supposed to handle mouse events while they can overlap with and cover other elements that must handle mouse events. When a mouse event occures, I want it to pass throuh all the elements that are not supposed to handle it to reach an element that might be covered by ...

XAML control to inherit from templates

What controls are there to inherit from that has the property of Children and supports templating when building a custom usercontrol. Currently I know about Panel, but it does not support properties and methods like DefaultStyleKey and GetTemplateChild(); Is there an interface that I can inherit from for templates such as: public clas...

How to give title to WPF pages

How to give title to WPF pages It is possible to give the title to WPF window through XAML code itself at design time and it is showing the title to window at runtime. the code in the XAML is like Window1.Title="FormulaBuilder" For the WPF pages also it is given in the XAML code like Page1.Title="EmployeeMaster" But it is not showing...

Adding .cs in a ResourceDictionary ?

Hello. I have DataTemplate in a ressource dictionnary, and in some, I need button and i don't know how i can use code behind for manage events. I tried to put a class in my resource dictionnary like that : <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/...

MDI and WPF Ribbon

Hello, i noticed that the WPF Ribbon is bound to a XAML Usercontrol or window. Lets imagine i have a windws.xaml page with a WPF Ribbon at the top. I want to create an instance such that once i click on one of the WPF Buttons, i am taken to a different XAML UserControl or "page". How do i do this? Will this new page have the WPF Ribb...

VerticalScrollBar Visibility Settings not Applied Correctly for Silverlight PasswordBox

I have the following Style settings for a Silverlight PasswordBox: <Style x:Key="s_DefaultPasswordBoxStyle" TargetType="PasswordBox"> <Setter Property="Margin" Value="0,0,30,0"/> <Setter Property="BorderThickness" Value="1"/> <Setter Property="Background" Value="{StaticResource TitleBarForeSolidColorBrush}"/> <Setter Property="F...

Can the WPF API be safely used in a WCF service?

I have a requirement to take client side XAML (from Silverlight) and create a bitmap merged with a server side resource (high res image) and can do this quite easily using WPF (DrawingContext etc). It has been mentioned that server side (hosted in IIS WCF) use of WPF is akin to running Office on the server and a really bad idea. Is WPF...

Get XAML source of WPF Window

Hi, I would like to get the XAML source of a WPF Window (MainWindow). Clicking on a button on that window would return the XAML of the window and I would save it in another file. Is this possible and how can it be achieved? Thanks! Satixx ...

How do I express static code in XAML?

Hi, I have a control that I would like to be static, but instead of writing it in code, i would like it to be in the XAML, so that I can still design edit and play around with it in Blend. Basically, within my class, I have the code: public static TextBox s_notepad = new TextBox(); I've altered my code to attempt to make it easier t...

Silverlight cannot update property after animation runs

Im trying to create a simple pan and zoom app using silverlight 4, but Im having trouble updating the TranslateTransform and ScaleTransform properties after I run an animation on them. I have tried to set the FillBehaviour to Stop, with no success. Here is the code that I have: <Canvas x:Name="LayoutRoot" Background="White" Width="800...

Cannot create unknown type '{clr-namespace:Blog.LongRunningWorkflow.Example.Activities}WaitForRequestApproval'.

Hi, I am facing problem in loading XAML at runtime. Below is the code please help me. public void ProcessRequest(Request request) { // Get the workflow instance id to use Guid instanceId = this.requestToInstanceMapping[request.Id]; // Setup the arguments that are passed to the workflow ...

How to get the content of a RichTextBox?

I would like to get the content of a RichTextBox as a string wich contains the XAML. I seen some post wich show differents solutions with another class for parsing the xaml and transforms it into a stringbuilder. But, my goal is to have the XAML directly generated. Thanks ...

Adding a trigger to a WPF custom control

Hi! I have a custom user control named DatePicker.xaml. Its code behind is DatePicker.xaml.cs: namespace GesHoras.UserControls { /// <summary> /// Lógica de interacción para DatePicker.xaml /// </summary> /// public partial class DatePicker : UserControl { <...> private int _day; private int _year; private int _month...

Use StaticResource in XAML root element

I want to use StaticResource in the root element of a xaml document. But MSDN says: Static resource references from within a resource dictionary must reference a resource that has already been defined lexically before the resource reference. Forward references cannot be resolved by a static resource reference. And this:...

Simple WPF formatting question

How can I prefix bound values in TextBlock controls in a StackPanel without using separate controls for the prefixes? E.g., let's say I have a dialog that uses a TreeView to display a list of books, with the top nodes being the title, and a set of subordinate nodes for the other book attributes (ISBN, Author, etc.). I have the binding ...

How to Bind Slider's Thumbnail size change to its value

I would like to know how can I use xaml code without extantional code? I want to create a Slider, that its Thumbnail change its size while moving up or down the slider's value. We know that we can use C# Converter is there a way to do that using xaml only. Thanks. ScreenShot [URL=http://img69.imageshack.us/i/wpfbind.jpg/][IMG]http://...

Is Element Binding to a Collapsed UserControl a Sloppy, Cheap Trick?

I'm sure that most of us will agree that it is possible to run out of declarative DataContext sources from parent or self contexts. We then might resort to Binding to a parent Tag and then use Element Binding. So the source might look like this: <Grid.Tag> <Binding Path="MyProperty" Source="{StaticResource MySource}" /> </Grid.Tag> ...

Control goes into a visual state - but actual visual states are not getting updated through xaml

I have two controls - control 2 inside of control 1. Control 1 and Control 2 have visual states. I am facing the following problem: Control 2 goes into a visual state, (have put a Debug.Write in the C# code), but doesn't get updated visually (specified in xaml - visual state). This happens quite frequently, but, not always. I have got...

WPF: Focus in a Window and UserControl

I'm trying to get a UserControl to tab properly and am baffled. The logical tree looks like this. |-Window -Grid -TabControl -TabItem -StackPanel -MyUserControl |-StackPanel -GroupBox -Grid -ComboBox -Textbox1 ...

switching wpf resource dictionaries at runtime

Hi all, I am trying to build a wpf application that allows the user to change the theme at runtime. What I have done so far is create a resourcedictionary with all the colors for the application defined in it and then I am binding to this dictionary in the xaml. Below is the code I have for switching the resource dictionary: if (Syst...