wpf

Is it possible to write a class that interacts with controls on my WPF form?

Hi all, I'm trying to write a class that I can use to interact with a group of similar controls in my wpf application. I have hit a few roadblocks and now I am wondering if this is a poor approach to begin with. I want to do this primarily to make my code more manageable - I have to interact with around 200 - 300 controls with my code,...

Selectable TextBlock or a TextBox with formatted text in WPF

I have a situation where I need to show a formatted text (normal, bold, highlighted) and should also be selectable so that user can copy the text. I have used textblock where i can apply multiple formattings using Inline content flow elements but unfortunately it's text is not selectable. Whereas Textbox allows to select text and copy...

Use AttachedProperty in Style in ControlTemplate

Here is my simple app: <Window x:Class="WpfApplication1.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:app="clr-namespace:WpfApplication1" Title="Window1" Height="300" Width="300"> <Window.Resources> <Style x:Key="Test"> ...

Datagrid results do not make sense.

I've been working with the datagrid in WPF with great results. However, it is now giving me unexpected results after some changes. BEFORE: I had a datagrid on a page. The DataContext was set to a List object that was created from a class that existed within the same WPF project. The empty row at the bottom of the datagrid, to add new re...

Getting an icon to always be unrotated regardless of parent rotations in WPF

Is there an easy way in WPF to specify the orientation of an icon (or Button, or any WPF object) so that it always effectively remains unrotated regardless of the rotations of the parent transforms? For example, I'd like to have an icon like this: + + + + + +++++ + + + + + + + However, if I dock it to the left side, i...

Why can VS not display my WPF application in the designer, but it can run it just fine?

This is absolutely ridiculous! Visual Studio is able to run (debug) my program just fine, but it won't display my layout in the designer. It just gives this useless error: Can anyone help explain this? I have not changed the XAML at all, not a single character, since the last time it worked fine. I've only changed some .cs code. ...

Silverlight and WPF Storing styles in a seperate DLL.

Is there a clean way to store styles in a separate assembly so they can be used by Silverlight and WPF? In an ideal world I would like to have MyCompany.Styles.dll. The styles would be shared between multiple WPF and Silverlight projects. ...

In WPF using a ListView is there an elegant way to auto resize items?

I recently wrote, my first, WPF application that has a list of items that are polled from a web-serivce. The items are displayed/data-bound in a ListView via a GridView. A background thread periodically polls the web-serivce and updates the list. If, say, I had three items initially bound to the ListView that simply display a descriptio...

WPF: Problem with SelectedItem for ComboBox

XAML: <ComboBox Height="27" Margin="124,0,30,116" Name="cbProductDefaultVatRate" VerticalAlignment="Bottom" ItemsSource="{Binding}"> <ComboBox.ItemTemplate> <DataTemplate> <Label Height="26" Content="{Binding Path=Value}"/> </DataTemplate> </ComboBox.ItemTemplate> </ComboBox> Set Data for cbProductD...

Microsoft learning support for VS2010

OK, I am a big fan of WPF, and while it is large area to fully understand, Microsoft has been great in posting loads of training video at http://windowsclient.net/learn/videos_wpf.aspx However with the release of 2010 it all seams to have gone very quiet. I expected a lot of the support to be updated for 2010 and I also expected a lo...

WPF Scroll Button (Hold down functionality)

Hey all, I have a listbox of items that I am using, and I have a button I made which scrolls up and down, but the only problem is, that you have to click every single time you want to scroll up and down a bit. I am looking for the functionality to simply hold down on the button and have it scroll.. is this possible in WPF? Perhaps I am ...

Using the MVVM Light Toolkit to make Blendable applications

A while ago, I posted a question regarding switching between a Blend-authored GUI and a Visual Studio-authored one. I got it to work okay by adding my Blend project to my VS2008 project and then changing the Startup Application and recompiling. This would result in two applications that had completely different GUIs, yet used the exact...

Where can I find the latest version of RibbonControlsLibrary.dll from Microsoft for WPF?

I have searched around and I can't seem to find where to download the latest RibbonControlsLibrary.DLL. Can someone please point me in the right direction? ...

WPF Moving Element problem

Hello, I am probably over-doing a very simple problem, but this is what I have a the moment: I have several buttons and a listbox of items in which the user can select and interact with. My application also moves those elements in accordance to the application width/height, such as follows: listBox1.Margin = new Thickness(this.ActualW...

Get rid of button border in WPF?

i am trying to get rid of button border and only display text, however a thin line around the text gets displayed even though i set borderThickness to 0 and borderbrush to transparent. my xaml code for save button: <Button Content="save" Name="btnSaveEditedText" Background="Transparent" Foreground="Wh...

Is there an easier way to typecast with unknown types?

Hi all. I am writing a function to recurse my XAML and add all the controls to a hashtable, with their names being the keys. Unfortunately it seems like I have to go through and list every possible type: void Recurse_Controls(object start) { string start_type = start.GetType().ToString(); if (start_type == "StackPanel") {...

Thin-border on WPF window?

I'd like to create a window, using WPF, that has a thin border all the way around the form - i.e. no space for the title bar with the icon/caption and min/max/close buttons. For example, the "extra" icons form of the new Windows 7 taskbar: I understand this can be done by setting the WindowStyle = None property, however, I am also usi...

C# WPF abnormal CPU usage for animation

I am developing WPF application and client reports extreamly high CPU usage (90%) (whereas i am unable to repeat that behavior). I have traced bootleneck down to these lines. It is simple glowing animation for small single led control (blinking led). What could be reason for this simple annimation taking up SO huge CPU resources? ...

WPF/Silverlight States - Activate from XAML?

Kind of a quick question: Is it possible to activate a viewstate from XAML? I have been only able to activate one from CS, using the VisualStateManager.GotoState() method. This would fix some of my MVVM issues if it were easily possible. Thanks ...

How to determine if a ResourceDictionary is loaded correctly

How can I tell (through the debugger if my app resources are being loaded correctly). I have tried (in f#) type MyApp() as this = inherit Application() do Application.LoadComponent(this, new System.Uri("/FSSilverlightApp;component/App.xaml", System.UriKind.Relative)) let cc = new ContentControl() let mainGrid :...