Search Results

Search found 11 results on 1 pages for 'morsanu'.

Page 1/1 | 1 

  • HTML Agility Pack - ReplaceNode doesn't change the InnerHTML of the Body

    - by morsanu
    Hi there, I have this The body: <body><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent leo leo, ultrices eu venenatis et, rutrum fringilla dolor.</p></body> The code: HtmlNode body = doc.DocumentNode.SelectSingleNode("//body"); Dictionary<HtmlNode, HtmlNode> toReplace = new Dictionary<HtmlNode, HtmlNode>(); // I do some logic here adding nodes to the toReplace dictionary. foreach (HtmlNode replaceNode in toReplace.Keys) { replaceNode.ParentNod.ReplaceChild(toReplace[replaceNode], replaceNode); } After i do this, the InnerHtml of the body node remains the same as from beginning, although the OutterHtml or the InnerText are showing the good result. Is there something wrong with my code? The result: // body.InnerHtml <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent leo leo, ultrices eu venenatis et, rutrum fringilla dolor.</p> // body.OutterHtml <body><p>Lorem ipsum dolor sit amet...</p></body>

    Read the article

  • WPF Canvas Binding

    - by morsanu
    Hey guys, I'm rather new to WPF, so maybe this is a simple question. I have a class that derives from Canvas, let's call it MyCanvas. And I have a class, MyClass, that has a property of type MyCanvas. In XAML, I built a TabControl, so each TabItem binds to a MyClass object. Now, in the Content of every tab I want to display MyObject.MyCanvas. How should I do that? <TabControl.ContentTemplate> <DataTemplate> <Grid> <myCanvas:MyCanvas Focusable="true" Margin="10" > <Binding Path="Canvas"></Binding> </screenCanvas:ScreenCanvas> </Grid> </DataTemplate> </TabControl.ContentTemplate>

    Read the article

  • WPF Separator position

    - by morsanu
    Hey, I'm using a Separator to draw a vertical line inside a Border. At first this was ok because the line needed to be centered, but now I need to position it at a custom x-position from the left border. Is there a way to do that? <Border x:Name="border" ClipToBounds="True" Background="White" BorderBrush="Black" BorderThickness="2"> <Separator BorderBrush="Black" BorderThickness="2"> <Separator.LayoutTransform> <RotateTransform Angle="90" /> </Separator.LayoutTransform> </Separator> </Border>

    Read the article

  • WPF RibbonTextBox Width problem

    - by morsanu
    Hey guys, It seems to me that the Ribbon control has a problem with textboxes. I was expecting a common TextBox control behaviour: a fixed width and a visible caret when the text exceeds the width. But the RibbonTextBox control changes its width and when the text exceeds the right limit, the overflow is not visible. I found a hack on a blog that does something like this: var img = SearchButton.Template.FindName("image", SearchButton); if (img != null && img is Image) (img as Image).Visibility = Visibility.Collapsed; var lbl = FindTemplateControl<Label>(SearchText); var border = SearchText.Template.FindName("Bd", SearchText); if (border != null && border is Border && img != null && lbl != null) { (border as Border).Width = SearchText.ActualWidth - (((Image)img).ActualWidth + lbl.ActualWidth); } but I reallly don't want to do such a workaround. Is there any other simpler way to achieve simple TextBox behaviour?

    Read the article

  • WPF User Control - Round corners programmatically

    - by morsanu
    Another WPF question... <UserControl x:Class="TKEApp.Components.UserControls.ButtonControl" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <Grid Background="Black"> <TextBlock Foreground="White" Background="Brown" Name="lblCaption" TextAlignment="Center"></TextBlock> </Grid> </UserControl> Somwhere in the application code I have an instance of this control and I need to make it's corners rounded programmatically. Is this possible?

    Read the article

  • WPF Border Thickness increase direction

    - by morsanu
    Hey. Another WPF question. In my XAML code I have a border: <Border x:Name="myBorder" Background="AliceBlue" Width="200" Height="200" BorderThickness="10" BorderBrush="Black"> </Border> and somewhere in code I increase the BorderThickness double thickness = myBorder.BorderThickness.Bottom + 2; myBorder.BorderThickness = new Thickness(thickness); and the result is that the border's weight increases but not outside the 200x200 width-height, but inner, decreasing the dimension. Is there a way to do the opposite?

    Read the article

  • WPF Bind User Control Coordinates

    - by morsanu
    Another beginner WPF question from me :) Ok, so I have a User Control added to a Canvas. In another area of the application I have two TextBoxes that will get 2 values : X and Y. I need a two-way binding between the user control's top left corner coordinates and those 2 textboxes. I don't mind implementing a Converter or doing some calculations, but I need a push in the right direction from a more experienced WPF developer.

    Read the article

  • WPF Validation on two properties

    - by morsanu
    I have a user control that contains a border somewhere in it. I am able to edit both the User Control Width and the Border Width from binding to two textboxes. I need to include validation when I create the binding in code so that the Border Width can't be higher than the User Control Width.

    Read the article

  • WPF DependencyProperty event before content changed

    - by morsanu
    First I will explain the context of the problem, because you might be able to point me in a better direction. I need to implement a undo-redo like system on an object. The object has a series of dependency properties. Some are double, int, string but some are also of DependencyObject type. I need to save the value of the property before it is changed, and for this I added the CoerceValueCallback. public static readonly DependencyProperty MyBackgroundProperty = DependencyProperty.Register("MyBackground", typeof(MyCustomizableBackground), typeof(MyComponent), new UIPropertyMetadata(default(MyCustomizableBackground), null, new CoerceValueCallback(OnPropertyChanged))); In OnPropertyChanged I save the value before it's changed. MyCustomizableBackground is the DependencyObject that has also some dependency properties. The problem is that in this case, where I have a custom object as a property, the OnPropertyChanged method isn't triggered, but when I have a common type, it is triggered.

    Read the article

  • WPF custom DependencyProperty notify changes

    - by morsanu
    Hey guys I have a class called MyComponent and it has a DependencyProperty caled BackgroundProperty. public class MyComponent { public MyBackground Background { get { return (MyBackground)GetValue(BackgroundProperty); } set { SetValue(BackgroundProperty, value); } } public static readonly DependencyProperty BackgroundProperty = DependencyProperty.Register("Background", typeof(MyBackground), typeof(MyComponent), new FrameworkPropertyMetadata(default(MyBackground), new PropertyChangedCallback(OnPropertyChanged))); } MyBackground is a class that derives from DependencyObject and it has some DependencyProperties. public class MyBackground : DependencyObject { public Color BaseColor { set { SetValue(BaseColorProperty, value); } get { return (Color)GetValue(BaseColorProperty); } } public static readonly DependencyProperty BaseColorProperty = DependencyProperty.Register("BaseColor", typeof(Color), typeof(MyBackground ), new UIPropertyMetadata(Colors.White)); [...] } Now, what I want is when a property from MyBackground is changed, MyComponent to be notified that MyBackground has changed and the PropertyChangedCallback named OnPropertyChanged to be called.

    Read the article

  • Gridview item template refresh

    - by morsanu
    <asp:TemplateField HeaderText="Quantity" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left"> <ItemTemplate> <%#GetQuantityRemaining((int) Eval("Id")) %> </ItemTemplate> <HeaderStyle HorizontalAlign="Left"></HeaderStyle> <ItemStyle HorizontalAlign="Left"></ItemStyle> </asp:TemplateField> Every time the user clicks on some buttons or modifies some fields, I need to update this field, calling the GetQuantityRemaining method again. Is there a way to do that?

    Read the article

1