When writing a UserControl, when and where can I access the ActualWidth property.
What is the correct place to execute code that requires the ActualWidth property. ...
What is the correct place to execute code that requires the ActualWidth property. ...
I've seen some examples of code where StoryBoard is used as Timer, such as: void Update() { if (_sb == null) { _sb = new Storyboard(); _sb.Completed += _sb_Completed; _sb.Duration = new Duration(TimeSpan.FromSeconds(1)); } if (_sb_completed) { _s...
I have a bunch of textblocks in an itemscontrol... I need to know how can I underline the text in the textblock based on whether the text is available in a list in the data model.. Sounds very simple to me...but I have been googling since the past 8 hrs... Can I use datatriggers and valueconverters for this purpose? If yes, then how ca...
I have: <StackPanel DataContext="{Binding Path =MyContext}"> <TextBox Text="{Binding Path =Content}" x:Name="tbName" IsReadOnly="False"> </TextBox> <CheckBox x:Name="cboxName" Content="Is null ?" Click="cboxName_Click" IsChecked="{Binding Path=THIS, Converter={StaticResource MyContextTo...
I have an enum on a viewmodel which represents one of 5 colors, and I am using a ValueConverter to convert these values into actual colors. Specifically it's for the color of each listbox item's background to change to as it is hovered over. I have a custom control with a visual state manager and a mouseover group which uses a SplineCo...
Hi Backgorund I am currently writing a program that allows a user to select a manufacture from a combo box. The combo box is created in wpf using the following wpf code segment: <ComboBox Height="23" Margin="40.422,128.423,229.908,0" Name="itemProductManufacture" ToolTip="Click to open drop down menu" VerticalAlignment="Top" Text="Sel...
Hi All, The listbox contain images and the object assigned to the listbox have corresponding wmv file path. How to bind the selected path the the mediaelement through {binding}. Geetha. ...
Hi there, I've been trying to do the following: Saving an outline drown using inkcanvas to bmp which is easy and already did using RenderTargetBitmap. Now what I want to achieve is to save a bmp image that has defined colors from a file for example for the background and the strokes. So what happenes is I have my transperent inkcanvas...
OK I got a project that has a application layer, web layer and a data layer shared by the other two layers. Now I have one part that is Hierarchical data that the application has to be able to look over, edit and add new to. So at the top is Company wich can have many Divisions and each division has Employees & Production Licenses (tw...
I have 4 buttons in grid which datacontext is set to an object which has property that indicates what button should be enabled (it's enumerable). Currenty I have done this in code-behind so that when that specific property changes, it disables all but one depending on the value. It works, but I really don't like to put stuff like this t...
I have an Expander control and i need to calculate its bounds without invisible elements and margins. It commonly can be done by VisualTreeHelper.GetDescendantsBounds. But it seems that the rect is calculated by VisualTreeHelper doesn't depend on the expander state. For example: http://i.piccy.info/i5/58/39/273958/collapsed.jpg (i can'...
Hi, I have an old VB6 application. I want to recreate it in VB.Net using WPF. But I am a bit confused about the "Model View Controller"-pattern. I have two books about design patterns (GoF and J.Bishop) afair this pattern is indeed not mentioned inside one of the two books. I have also searched the internet I found some java-examples. Bu...
I want' to define that every control of specific type inisde a grid gets a Style. This is easy just put the styles with TargetType inside the grid resources. But what then if I wan't to reuse this grid as a style? I can create a grid style and have a setter to resources but can only put one style there. <Style x:Key="GridStyle" TargetT...
On the main window onClick I have AddNoticeAboutWrongCity addNoticeAboutWrongCity = new AddNoticeAboutWrongCity(); addNoticeAboutWrongCity.DataContext = ((VerificationViewModule)this.DataContext).WrongCityNotice; addNoticeAboutWrongCity.ShowDialog(); At popup window there a lot of textboxes and two buttons Delete object: this.DataC...
Hello, in my application I'm opening a Window as a dialog. Inside this window, there's a TextBox called "myText". When the dialog is shown, I want the cursor to be automatically inside the "myText" TextBox, so the user can immediately enter something without having to click in the TextBox. I however have problems realising this, can som...
I'm loading an image in WPF by using the BitmapImage class. My code works perfectly when I give an absolute path for the UriSource but not when I try and use a relative path. My XAML is: <Image Width="50" Name="MemberImage" HorizontalAlignment="Left"> <Image.Source> <BitmapImage DecodePixelWidth="50" UriSource="questionmar...
As the title suggests, I just want to display a standard windows error icon for a custom exception handler. What the easiest way to achieve this using WPF? For example, the red cross in this dialog: ...
Hi, I have a ContentControl element whose ContentTemplate is determined at run time from the Resource Dictionary. In the datatemplate I have a visual (Convas) and what I want is to also have a button in datatemplate which when clicked should print the visual element(canvas). As I said that the DateTemplate is inside the Resource Diction...
I am currently working on a new project of mine that is going to be a data record visualizer (for records in Pascal). It should provide a way to define a given record with data fields and pointer fields and then there will be an example view where you can see the record "in action". Now the problem I am having is that in this model ther...
I want to create spider diagram or tree diagram like this video from youtube http://www.youtube.com/watch?v=MRijN4oMKkg by using WPF with C# ...