How do you display a custom UserControl as a dialog in C#/WPF (.NET 3.5)?
How do you display a custom UserControl as a dialog in C#/WPF (.NET 3.5)? ...
How do you display a custom UserControl as a dialog in C#/WPF (.NET 3.5)? ...
I sell a WPF application, on one customer machine (out of several hundreds) the entire application window is black, anyone know what's going on? The machine is running Windows XP with .net 3.5SP1, the graphic adapter is GeForce 6200 with two monitors (disabling one monitor doesn't solve the problem). Setting "Compatibility settings" to...
I am trying to make play/pause button. When the Play button is clicked, it will bind to the StartStopWatch command. The play button will then change to a pause button which will bind to the PauseStopWatch command. My problem is. I don't know how to keep the style it has and change them interchangablly. Currently I have two different butt...
I have created a WPF app where I dynamicly build XAML elements using c# code and then add them to a root "container" grid. What I'm trying to do is take advantage of the features in Blend and create some XAML Pages that have their own set of code behind logic, Storyboards, etc. I want to load that XAML at runtime, however for some rea...
I have an external style resource in a resource dictionary I'm referencing with x:Key. It has an x:TargetType specifying a target (TextBlock). Is it possible to apply this to a control containing a TextBlock and have all TextBlock elements within that control have the style applied? Thanks, Robert ...
Hi Folks, I'm trying to use WPF animation to creat an effect where, when the data in a text property changes, the text fades out, then in again.. or preferably a proper crossfade. I have successfully got half of this working, the code below responds to the text changed event, immediately makes the text invisible then fades it in over 3...
So, I'm using a third-part wpf grid control that is hard-coded to only accept certain keystrokes to perform short-cut reactions and one of those is Shift-Tab. However, my user-base is used to hitting up arrow and down arrow and telling them 'no' isn't an option right now. So my only option I think is to intercept the preview key down an...
Hi everyone, I've got a scenario where I have a GroupBox which has a bit of content in it. I'm looking to add ContextMenu to that GroupBox and have that menu shown when the user right-clicks anywhere in the box. The problem I have is that the context menu only appears when the border or the header of the group box is clicked. If you cl...
Hi .. I draw two spheres in 3d WPF which has points like Point3D(0,0,0) and Point3D(-1.0,1.0,2.0) with the radius is 0.10 Now i want to draw a Cylinder joining these spheres, the only thing i have for this is radius 0.02. I want to know how to calculate the 3d point, height, direction etc for this cylinder. I tried by finding the ...
Given xml that looks like this: <Root> <Fruittree name="Apple" ID="2"> <Branch name="West" ID="1"> <Fruit name="Foo"> <Fruit name="Bar"> </Branch> </Fruittree> <!-- more fruitrees etc... --> </Root> Using xaml with a XmlDataProvider and a DataTemplate, I want to display a list, perhaps in a listbox: ...
I'm trying to databind to this ItemsControl: <ItemsControl ItemsSource="{Binding Path=Nodes, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <Canvas /> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> </ItemsControl> By using this DataTemplate, I'm ...
Hi, I'm using this workaround to get a CommandProperty for mouse actions such as a left double click: http://www.wpfmentor.com/2009/01/how-to-add-binding-to-commandparameter.html It works fine... I'd like to use that workaround with a DataTemplate but {Binding Path=ID} doesn't seem to work for the DataResource.BindingTarget as it do...
I would like to set the Culture of a WPF application to a specific one based on user preferences. I can do this for the current thread via Thread.CurrentThread.Current(UI)Culture, but is there any way to do this globally for the application (so it affects all threads by default)? ...
I want to define the "Auto" width of a GridView Column in the code. How can i do that? var grid = (GridView)myListview.View; grid.Columns.Add(new GridViewColumn { Header = "My Header", DisplayMemberBinding = new Binding("MyBinding"), Width = ??? // Auto }); ...
I have a textbox that contain a string that must be binded only when the user press the button. In XAML: <Button Command="{Binding Path=PingCommand}" Click="Button_Click">Go</Button> <TextBox x:Name="txtUrl" Text="{Binding Path=Url,UpdateSourceTrigger=Explicit, Mode=OneWay}"></TextBox> In the code-behind: private ...
How do I do the following via C# (as I'm generating ListViews programatically): <ListView> <ListView.Resources> <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Transparent"/> <SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="Transparent"/> </ListView.Resources> ... ...
Ive created templated column in DataGrid with textbox in header template for grid filtering. Is it possible to make dynamic resize of textbox, so that textbox was 100% width of columns width? <my:DataGrid AutoGenerateColumns="False" Name="dgEmployees" IsReadOnly="True" Background="DarkGray" GridLinesVisibility="All" SelectionChanged="dg...
In my WPF application I have this: <StackPanel> <TextBlock> <Hyperlink> <TextBlock TextWrapping="Wrap" Name="HyperlinkText" /> </Hyperlink> </TextBlock> </StackPanel> But if I set HyperlinkText.Text to a long text that wraps, the whole text is underlined only once at the bottom (see image). Is there a way to have ...
Hi, I'm getting floating point values like (471, 326.723333333333) from calling MouseEventArgs.GetPosition() on my border control. While I can always round the numbers manually, I was wondering if there's some kind of setting to just get whole numbers. I thought putting SnapsToDevicePixels to True on my border control would help but it...
The webrowser control has a navigating event that is raised before the browser navigates to a URL, but what I need is a preview event for when the webbrowser requests referenced media/pages/css. For example when a image tag is seen by the control, it will request the image from its URL. I need to proxy this URL to decide if I should disp...