xaml

Get months in view in radcalendar

I am using a telerik RadCalendar in my WPF project. I am using a 3 months view style so at a time 3 months are displayed. When you press the left arrow, the previous 3 months are displayed and so on.. Is there a way to get all 3 months in view at a moment. example if May, June and July are currently being displayed then I should get 5,6 ...

Telerik RadCalendar set focus on more than 1 dates

I want to focus on multiple dates in multiple months in a 3 month wide telerik RadCalendar view on my WPF project. Right now only the current date (today's date) gets highlighted (or focused). I want to focus on other dates too besides today's date. Any suggestions/ideas how to go about it? ...

Setting XAML attributes gets overwritten at runtime?

When I use the following line, implementing a templated control from a Silverlight class library; <labelSliderControl:SliderControl x:Name="sldX" Label="X" Value="4" /> I see in the VS Disign view the Slider getting the value of 4. But when I run the app the Slider starts at 0. So when I change the attribute in XAML I can see the c...

WPF, Xaml and Controls Factory?

I'd like to create WPF control which consists of few another controls. The main problem is how implement choosing right control depending on Model's type? <MyControl> <!-- if DataContext.GetType() == Type1 --> <Control1 DataContext = {Binding}/> <!-- if DataContext.GetType() == Type2 --> <Control2 DataContext = {Binding}> </MyControl> ...

Display PDF in a BookControl. Convert PDF to XAML?

I've got a PDF I'd like to show in a Book Control. Since this control can't use PDFs I have to work around it by either using images or converting the PDF to XAML. What is the most elegant way to do this? ...

USE of XAML not related to WPF or silvelight

Hi, I am trying to understand the use of XAML instead using it as markup in creating WPF and silverlight applications. Where else could i use XAML. Please provider all the possible uses of XAML. Could XAML be used as regular XML to provider mapping and related stuff? Please provider some links where i could learn about XAML. Thanks...

WPF: Show custom Preview-picture for video (MediaElement)

WPF: Show Preview-picture for video (MediaElement)I've got a video as a MediaElement <MediaElement Name="video" LoadedBehavior="Manual" ScrubbingEnabled="True" Loaded="MediaElement_Loaded"" Source="Resources\blickpunkt10.mp4" /> I want to show a custom picture while the user didn't tap the video. How to do this? ...

Binding to nested Property of Custom Object

I want to bind a column of my DataGrid to a nested property. I have defined these two classes: public class ViewObj { public cCar car { get; set; } public string name { get; set; } } public class cCar { public int ps { get; set; } public int wheels { get; set; } } The class cCar is a property of the class ViewObj. ...

VisualCollection and ContentPropertyAttribute in XAML

Hello, I want to write a custom FrameworkElement which host Visuals. My first attempt was to create an instance of ContainerVisual and write a wrapper property for ContainerVisual.Children and then set it as ContentProperty so I can and Visuals via XAML. But VisualCollection does only implement ICollection and not IList or any supported...

How to create two HierarchicalDataTemplates which are mutually-referential in Silverlight?

Given that: DataTemplates cannot be assigned by TargetType StaticResource references can only reference previously How does one template the following situation in a TreeView? class Resource { public string Name {get;} public IEnumerable<Property> Properties {get;} } class Property { public string Name {get;} public IEn...

Problem animating a WPF button

I have a button, this is a unique button, and his style should çn't match the style of all the others. So when you pass your mouse over this button, it should change its image. But it is not working, Here is the code... I'm starting at WPF so if you can point me what am I doing wrong would be really appreciated <Button Name="RemoveButto...

Print documents via Wpf-controls and convert to XPS.

I'm trying to convert XAML control to XPS document, but i'd like to do this in batch mode - render control in memory and print it to XPS without rendering it on the screen. This project should work even without GUI. I've read Related topic on stackoverflow, but it's not working properly. I can create control, set DataContext, but output...

Trouble displaying Enums in a Combobox in WF4

I'm trying to follow the solution from this post in my WF4 project: http://stackoverflow.com/questions/58743/databinding-an-enum-property-to-a-combobox-in-wpf#62032 And I've implemented the code <ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type s:Enum}" x:Key="DayOfWeekValues"> <ObjectDataProvider.MethodParame...

Hide TreeView root node in WPF

Hello, Can someone tell me how to hide the root node of a TreeView in WPF/Silverlight? I would still like to display hierarchical data and to be able to expand collapse nodes except for the root node (which shouldn't be displayed at all). Regards, Xam ...

Silverlight 4 - XamlParseException: Failed to create a 'System.Type' from the text 'local:CustomerEntity'

I am getting this exception when trying to debug a Silverlight 4 application in Visual Studio 2010. The exception will be thrown after it passes the InitializeComponent() line. The exception will only happen during debugging, but it does not seem to be a problem to the Visual Studio Designer. System.Windows.Markup.XamlParseException occ...

WPF UserControl with generic code-behind

I have this code behind: CustomUserControl.xaml.cs namespace MyProject { public partial class CustomUserControl<T> : UserControl { ... } } and this xaml: CustomUserControl.xaml <UserControl x:Class="MyProject.CustomUserControl" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" x...

Is it possible to add a default ComboBox entry with command binding in XAML?

I'm working on my first true WPF MVVM pattern application. Currently I have a number of ComboBoxes on various screens that are bound to Collection classes and properties of the relevant ViewModel class. They always have an entry with the text <Add>, which is really an empty object class and I currently use it to trigger an AddNewObject...

ChangePropertyAction to modify Visibility not working in ListBoxItem DataTemplate.

I am trying to change the visibility of a control in a ListBoxItem template (based on it beeing selected in the parent listbox) through a ChangePropertyAction but the code below does not work. I tried fiddling around with setting the TargetName on the trigger or setting the default visibility of the control through a style. I debugged th...

How to Bind to a Child's Background in Xaml?

I'm able to bind to a child's Background if the child is explicitly named in ElementName: <TreeViewItem Header="Test" Background="{Binding ElementName=TestChild, Path=Background}"> <TextBox Name="TestChild" Text="Hello?" Background="{Binding SomeBinding}" /> </TreeViewItem> I'd prefer to use relative position rather than specific n...

How do I make a XAML GridView display one of several images, depending on a DisplayMemberBinding?

Hi, I've got an Enum called "DoYouKnow", containing Yes, No and Unknown. I have a column in a GridView which currently displays "Yes", "No" or "Unknown" in each row, based on a DoYouKnow value I've attached it to using DisplayMemberBinding. Instead of displaying I would like to have this column display a tick, a cross or a question ma...