View Poll Results: Do you clean your Xaml?

Voters
5. You may not vote on this poll
  • Yes

    3 60.00%
  • No

    2 40.00%
Results 1 to 10 of 10

Thread: Do you clean your Xaml?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2008
    Location
    Rep of Ireland
    Posts
    1,380

    Do you clean your Xaml?

    Consider the designer's Xaml?

    PHP Code:
    <Window x:Class="Window1"
        
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        
    Title="VB:e Syntax Highlighter" Height="300" Width="371" WindowStartupLocation="CenterScreen" WindowStyle="SingleBorderWindow" ResizeMode="NoResize">
        <
    Grid Width="349">
            <
    ComboBox Height="23" Margin="12,0,0,12" Name="ComboBox1" VerticalAlignment="Bottom" HorizontalAlignment="Left" Width="120" Background="WhiteSmoke">
                <
    ComboBoxItem>Visual Basic</ComboBoxItem>
                <
    ComboBoxItem>WPF Xaml</ComboBoxItem>
                <
    ComboBoxItem>C#</ComboBoxItem>
            
    </ComboBox>
            <
    ComboBox Height="23" Margin="0,0,91,12" Name="ComboBox2" VerticalAlignment="Bottom" HorizontalAlignment="Right" Width="120" Background="WhiteSmoke" BorderBrush="#FF707070" BorderThickness="1">
                <
    ComboBoxItem>HTML</ComboBoxItem>
                <
    ComboBoxItem>BB Codebox</ComboBoxItem>
            </
    ComboBox>
            <
    Button Height="23" HorizontalAlignment="Left" Margin="264,0,0,12" Name="Button1" VerticalAlignment="Bottom" Width="75" Background="WhiteSmoke">Go!</Button>
            <
    Label Height="28" HorizontalAlignment="Left" Margin="12,0,0,32" Name="Label1" VerticalAlignment="Bottom" Width="120" VerticalContentAlignment="Bottom">Source:</Label>
            <
    Label Height="28" Margin="138,0,91,32" Name="Label2" VerticalAlignment="Bottom" VerticalContentAlignment="Bottom">Output:</Label>
            <
    RichTextBox Height="194" Margin="10,10,12,58" Name="RichTextBox1" Width="327" />
        </
    Grid>
    </
    Window

  2. #2

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2008
    Location
    Rep of Ireland
    Posts
    1,380

    Re: Do you clean your Xaml?

    I ask because I wanted to know if you found it helped you learn xaml better?

  3. #3
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: Do you clean your Xaml?

    I dont get ya, do you mean do we go through and delete what the designer has put in there?
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2008
    Location
    Rep of Ireland
    Posts
    1,380

    Re: Do you clean your Xaml?

    Yeah if its not needed, like names and that also, do you format your xaml to make it more readable?

  5. #5
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: Do you clean your Xaml?

    One thing I dont like about the XAML editor is that it does not tidy itself up like the VB editor. I mean it doesnt insert tabs in the right places automatically when you delete something to make it more readable like it would in VB.NET code. So yes, I do spend a fair amount of time tidying up my XAML to make it more readable... but then I delete some of it and have to spend ages tidying it up again so get bored of that quite quickly and it becomes a mess again

    I dont find that the designer sticks much unnecessary stuff in there to be honest so I rarely actually remove something the designer has inserted as that usually brakes something :P
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  6. #6
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,522

    Re: Do you clean your Xaml?

    I use the split view a lot.... when I'm messing with the properties, I tend to jsut do it right in the XAML rather than the properties window... So far I haven't found anything unnecessary, unlike what I get when I build a webform in VS. So far, I haven't experienced a problem with the indents eitehr, but then I've only scratched the surface.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  7. #7

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2008
    Location
    Rep of Ireland
    Posts
    1,380

    Re: Do you clean your Xaml?

    I like to work with the Xaml too but felt that maybe I was overdoing it simply because I tend to hook events and set properties in Xaml. I just find it a good idea to clean as I go reagarding the Xaml of a window.

  8. #8
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: Do you clean your Xaml?

    Yeah I use the split view all the time, and I do try to do as much in XAML as I can as thats the whole idea of it really isnt it, to keep all the UI stuff in there. However at the moment as I am not particularly adept I do have to admit to using the MouseEnter and MouseLeave events in my code-behind file instead of XAML triggers for some controls :P You just get that little extra bit of control as you can do things like check to see if an animation is already running and check other variable values etc
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  9. #9

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2008
    Location
    Rep of Ireland
    Posts
    1,380

    Re: Do you clean your Xaml?

    I agree, I also would like to stress the idea of the code behind is still to enhance the UI. I tend to pass the logic of to other objects outside of the window declaration, that way I don't feel as guilty writing code behind ha ha!

  10. #10
    Hyperactive Member
    Join Date
    Mar 2008
    Location
    Zeist, The Netherlands
    Posts
    266

    Re: Do you clean your Xaml?

    I try to do everything in the XAML, but I'm stilll very new to WPF, so sometimes I have to find other ways to find out how I can do what I want to do. But clean up the XAML? Most certainly....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width