How can I convert this XAML code into C# code?
How can I convert this XAML code into C# code? <Window.Resources> <DataTemplate x:Key="itemtemplate"> <TextBlock Text="{Binding Path=Text}"/> </DataTemplate> </Window.Resources> ...
How can I convert this XAML code into C# code? <Window.Resources> <DataTemplate x:Key="itemtemplate"> <TextBlock Text="{Binding Path=Text}"/> </DataTemplate> </Window.Resources> ...
I have an application which pulls xaml page paths from a database. I can then use a navigationservice to navigate to the relevant page when need be. However, I have run into a scenario where I would like to instantiate the page with a specific constructor before navigating to that page. Is it possible to take a string value such as "\Pa...
I have a WPF application containing a Frame control. The frame control displays the html content. The html page contains a javascript function which i want to call after html page is loaded on Frame and from the WPF code ? Is there a way i can call javascript mehtod of html page loaded in WPF frame control and from within WPF code? ...
Hi All, I have a datatemplate defined in a xaml file and i wana access it via c# code. Can anyone please tell me how can i access it? I added a new ResourceDictionary file and it's name is Dictionary1.xaml there I have a data template like <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x...
I've created a WPF application where the title bar and chrome are turned off. I have a border around the entire app, with the idea that it would act like the chrome in some regards. The first thing I'm trying to do is have the mousemove event capture the movement of the mouse when the mouse is clicked, so that the window moves with the m...
In WPF, is there an easy to allow overwriting of text in an textbox? Thanks Tony EDIT: I guess i wasn't to clear. Sorry. I have a TextBox that the user is allowed to type 6 characters. If the user types 6 characters and then for whatever reason put the cursor at the start or somewhere in the middle of the 6 characters and starts to ty...
Hopefully someone can help because I haven't been able to figure this out. Here's my xaml code for the popup/combo box, please not there is other code before and after this for the rest of the layout. <Popup x:Name="popupMethods" Height="400" Width="150" StaysOpen="False" Placement="Bottom" IsOpen="false" HorizontalA...
I have a WPF Popup control that contains some editing controls (list boxes, text boxes, check boxes) laid out with quite a bit of whitespace. Popup.StaysOpen is set to False, which is required. If the user clicks elsewhere in the application, the editing operation should be considered aborted and the popup should close. Unfortunately ...
I want to create a ListBox filled with checkboxes in WPF, and I want to databind the "Content" value with a simple string value. However when I try <CheckBox Margin="5" Content="{Binding}" /> the app crashes. This is what I have. ( I'm sure I am missing something simple ) <ListBox Grid.Row="1" IsSynchronizedWithCurrentItem="True" x:Nam...
Hello, Let's say I have some multiline text that I'd like to format, and let's also say that it's databound. So, in XAML: <TextBlock TextWrap="Wrap"> <TextBlock.Inlines> <Run TextWeight="Bold" Text="{Binding Path=FirstName}" /> <Run TextStyle="Italic Text="{Binding Path=LastName}" /> </TextBlock.Inlines> </Text...
Long ago, I looked at this MSDN walkthrough. It implements a color editor, and the tooltip uses the color's name like "Red" or "Blue". Today, I'm implementing a ListBox that is similar; it displays a box with the color and the name of the color next to it. Except in my application, all of the color names display as the hex values like...
How can you access WPF's built-in styles/templates? For example I'm trying to move the NavigationWindow's chrome to the bottom of the window. I've seen Microsoft's NavigationWindow template example but it is quite verbose and doesn't reuse the default navigation chrome. I've also tried looking at the tree inside Snoop. All the chrome ...
I can't figure out what is wrong for this simple binding. when click on first or second radio button, no first or last name display. 1) Xaml <Window x:Class="WpfApplication2.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-nam...
I have a Treeview showing Xml data where each element is wrapped in a class that exposes IsExpanded, the wrapped XElement's Name and Value and a boolean MatchesFilter which is set if the element matches a specific filter; I'd like to change the foreground color if MatchesFilter is true. What I currently have is: <TreeView.ItemTemplate...
Hi Girls and Guys! I'm just about to start a new project of mine and am currently evaluating some techniques for localization, modularity etc. I have (at least in my opinion) a pretty good approach to localization but now I struggle to find a good solution for databinding. I want to bind values of textfields etc. (UIElements in genera...
I have two WPF list boxes. One is a list of lists (actually a List of ObservableCollection), the other is a list of all known instances of "Thingy". Here's the datatemplate I'm using for the "thingy" class. <DataTemplate DataType="{x:Type Model:Thingy}"> <StackPanel Orientation="Horizontal"> <CheckBox x:Name="ThingyInLis...
I have a datepicker control that I am using to set a date field in a gridview control, my datepicker shows a date and a button to display a calendar you can use to pick a date. This works great on its own but when I add this to a gridview the calendar pops up and the columns and rows cover up parts of the calendar. Setting the ZIndex fo...
I would like to add a semi-transparent colour over the contents of a WPF window (to indicate the state of the window). Currently I am using a UserControl that fills the Window, and I change the Background colour and Visibility as required. The problem with this method is when the UserControl is visible, I cannot click any controls (Butt...
I can't come up with a solution for this problem in XAML: I want to animate the width of the right button to a certain value when IsMouseOver of the left button is true. I dont know where to put this: in a style or template of one of the buttons or in a style on the grid. Is it even possible? <Border Style="{StaticResource ContentBodyS...
I'm about to finish the core components of my application and I'm willing to change gears soon and do a bit of GUI programming. From the beginning I decided to write a WPF-based application for two reasons: a) I want my application to be visually stunning and 100% skineable. b) I completely suck at designing user interfaces and then som...