wpf-controls

Capturing all requests and responses from the web browser control?

99封情书 提交于 2019-12-09 06:01:47
问题 Is there way to capture and print out all of the requests and responses from the web browser control including asynchronous requests? 回答1: Have you thought about using Fiddler? They even have an API that you might be able to use for this. Edit You can try using the Navigated event or LoadCompleted event for getting response information. You might be able to use the Navigating event for request information. These events might occur with async requests, but I'm not sure on that. The Edit

WPF Checkbox style change

萝らか妹 提交于 2019-12-09 05:20:46
问题 I have just started with WPF and need specific feature for a checkbox: I want to change the shape from a box to a ellipse. Futher more there should be a color change (green = true, red = false) instead of cross. The background: I have different sensors and want to enable/disable them via these checkboxes. I also thought about to use buttons instead of checkboxes, but I think the function is more given by the checkboxes. I hope my description is understandable. Is it possible to define such a

Is it possible for a WPF control to have an ActualWidth and ActualHeight if it has never been rendered?

笑着哭i 提交于 2019-12-09 00:39:07
问题 I need a Viewport3D for the sole purpose of doing geometric calculations using Petzold.Media3D.ViewportInfo . I would prefer not to have to place it in a Window or otherwise render it. I'm attempting to accomplish this by instantiating a Viewport3D and setting a few properties using the following C# method: private Viewport3D CreateViewport(MainSettings settings) { var cameraPosition = new Point3D(0, 0, settings.CameraHeight); var cameraLookDirection = new Vector3D(0, 0, -1); var

Stopping WPF TextBox from growing with text

你说的曾经没有我的故事 提交于 2019-12-08 23:19:43
问题 I am trying to modify my simple control so that the text box does not grow as the user types in long text. I took a look at some solutions posted here at Stackoverflow that suggest using a Grid and an invisible Border and binding the Width of the text box to the ActualWidth of the Border, but I can't seem to get it to work in my setup. Here is the xaml of my control: <StackPanel Margin="5,0"> <WrapPanel Margin="0,0,0,5"> <TextBlock Foreground="White" Margin="0,0,2,0">TEXT</TextBlock>

Changing Label properties programmatically

无人久伴 提交于 2019-12-08 21:09:39
问题 The problem is that I need to change Label FontWeight and FontStyle programmatically but nothing seems to work... this is what I've tried so far: label.FontWeight = FontWeight.FromOpenTypeWeight(99); For label.FontStyle I have no idea, I got stuck here: label.FontStyle = new FontStyle(); I have no idea what to do from there on. I googled like crazy but found nothing. Thanks in advance for any suggestion! 回答1: For FontStyle you can use the FontStyles class in the code-behind, and for

WPF: How to get Radiobuttons to display as a horizontal row of ToggleButtons

时光怂恿深爱的人放手 提交于 2019-12-08 19:25:20
问题 I'm currently building a UI that is going to be used in a touch panel. Therefore, I would like to display any RadioButton groups as horizontal rows of ToggleButtons. I already figured out how to display ToggleButtons instead of the standard bullet items: <Style x:Key="{x:Type RadioButton}" TargetType="{x:Type RadioButton}" BasedOn="{StaticResource {x:Type ToggleButton}}"> However, this will show a column of ToggleButtons, not a row . Do you know an easy way to do this? Thanks a lot! 回答1: Put

Context Menu vs Popup

孤者浪人 提交于 2019-12-08 19:16:58
问题 What is the difference between a ContextMenu class and the Popup class? 回答1: The MSDN docs do a nice job of displaying the distinction: The Popup Class: Represents a pop-up window that has content. The ContextMenu Class: Represents a pop-up menu that enables a control to expose functionality that is specific to the context of the control. So the ContextMenu is a more-specific version of a Popup - it's meant to be bound to a specific control, providing ways to interact with that control. Read

Update all bindings in UserControl at once

丶灬走出姿态 提交于 2019-12-08 17:35:57
问题 I need to update all the bindings on my UserControl when its visibility changes to Visible. Pretty much all my bindings are bound to the DataContext property of the user control so I'm trying to update the target of that binding: BindingOperations.GetBindingExpressionBase(this, UserControl.DataContextProperty).UpdateTarget(); But I get null as the result of GetBindingExpression(..) method and I'm wondering if I'm using this wrong. Also, is there any other good way to refresh all bindings on

RibbonGallery disabled in .net 4.6

纵然是瞬间 提交于 2019-12-08 16:38:27
问题 I'm creating an application using RibbonController in WPF. It's working fine until i installed .net 4.6. Then my "RibbonGallery" is disabled state (Viewpoints Drop Down menu) . I tried to enable through Code also but no luck ;(. <Custom:RibbonGallery SelectedValue="Entrancelobby" SelectedValuePath="Content" ScrollViewer.VerticalScrollBarVisibility="Visible" MaxHeight="500"> <Custom:RibbonGalleryCategory Name="viewpointsList" FontFamily="Times New Roman" FontSize="14"> <Custom

WPF Popup : open with animation

风格不统一 提交于 2019-12-08 15:56:46
问题 I am using a wpf popup control. <Popup x:Name="tabHolder" IsOpen="False" PopupAnimation="Slide" Placement="Bottom" PlacementTarget="{Binding ElementName=mainWidgetWindow}"> <Grid Height="105" Width="315" /> </Popup> Here I have set popup animation property to slide. But when it opens, it doesn't animate. Do I have to add any other configuration for popup to open with animation option slide? I am using .net framework version 3.5. 回答1: From MSDN A Popup can only animate when the