Entries:
Comments:
Posts:

Loading User Information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading User Information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

Discussions

William Kempf wkempf
  • WPF Layout Issues

    No offense, but are you reading what I write?  In the first post, you give a solution I specifically said wasn't valid in my blog post.  Now you're talking about adding list items in order to get a vertical scroll bar, when I clearly said the issue with the "hack" solution you first gave was that I still needed a horizontal scroll bar.

    Here's a severe hack (severe in that the code is ugly) that almost works:

    <Page
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
      <ListBox>
        <ListBox.ItemsPanel>
          <ItemsPanelTemplate>
            <StackPanel/>
          </ItemsPanelTemplate>
        </ListBox.ItemsPanel>
        <StackPanel>
          <Grid>
            <Grid.ColumnDefinitions>
              <ColumnDefinition/>
              <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <TextBlock Grid.Column="0" Text="Title Here"/>
            <TextBlock Grid.Column="1" Text="Price" TextAlignment="Right"/>
          </Grid>
          <TextBlock
            TextWrapping="Wrap"
            MaxWidth="{Binding RelativeSource={RelativeSource AncestorType={x:Type ListBox}}, Path=ActualWidth}"
            ><![CDATA[
    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas sed neque et tellus tincidunt interdum. Morbi diam eros, imperdiet at, volutpat et, vestibulum quis, sem. Curabitur eu tellus vel felis molestie malesuada. Pellentesque nec lacus. Aenean fringilla nonummy sapien. Morbi eu odio at turpis cursus tristique. Integer nec lectus sit amet turpis bibendum feugiat. Cras posuere condimentum sapien. Vivamus accumsan, lacus at bibendum vehicula, magna elit consectetuer diam, ac luctus elit diam non leo. Vestibulum lobortis augue nec nisl. Fusce viverra purus consequat lacus. Nullam elementum mattis tellus. In hac habitasse platea dictumst. Aliquam ac velit sit amet urna placerat fringilla. Fusce mattis arcu eget urna. Sed lacus.
      ]]></TextBlock>
        </StackPanel>
      </ListBox>
    </Page>

    I say "almost", because the ActualWidth of the ListBox is greater than the actual width needed for the contents (it includes "non-client" area content, such as the listbox border).  So at certain sizes (the majority of the time) the contents will be wider than the client area and, though the text now wraps, we have a horizontal scroll bar and some of the text (including the price) is clipped.

  • WPF Layout Issues

    NuTcAsE wrote:
    

    Set the Listbox's ScrollViewer.HorizontalScrollBarVisibility to disabled. That should wrap the TextBlock elements contents.

    Example (extracted from your blog entry):

    <Window
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
     x:Class="Test.Window1"
     x:Name="Window"
     Title="Window1"
     Width="640" Height="480">

     <Grid x:Name="LayoutRoot">
      
      
      <ListBox HorizontalContentAlignment="Left" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
       <ListBoxItem HorizontalContentAlignment="Stretch" HorizontalAlignment="Stretch">
        <StackPanel>
         <Grid>
          <Grid.ColumnDefinitions>
           <ColumnDefinition/>
           <ColumnDefinition/>
          </Grid.ColumnDefinitions>
          <TextBlock Grid.Column="0" Text="Title Here"/>
          <TextBlock Grid.Column="1" Text="Proce" TextAlignment="Right"/>
         </Grid>
         <TextBlock TextWrapping="Wrap">
          <![CDATA[
           BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH
           BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH
           BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH
           BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH
           BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH
           BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH
           BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH
           BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH
          ]]>
         </TextBlock>
        </StackPanel>
       </ListBoxItem>
      </ListBox>
     </Grid>
     
    </Window>



    Nope.  I discussed that in the blog post.  That's a hack that only works in specific scenarios.  Even in this simple scenario, if I want to ensure the title and price isn't sized below a certain point, this hack no longer works.  You need scrollbars, but you still want the text to wrap.

  • WPF Layout Issues

    I've posted a blog entry about some WPF layout issues.  This isn't a post to direct traffic to my blog... there's not enough content there for it yet.  Rather, because the blog doesn't have many readers, I'm just hoping this post will get someone with WPF knowledge and experience to have a look and provide me with some technical feedback.

    To summarize, the issue is that TextBlock's, when TextWrapping is set to Wrap, will often still cause layout panels to have very large widths instead of wrapping the text.  For examples and details, check out the blog entry.

  • I love Channel 9

    fdisk wrote:
    In a word, this place is brilliant.


    This is the strangest thread I've read on C9.  For the record, here's the original post:

    fdisk wrote:

    I Get It Now

    Channel 9, that is.

    After extensive observation and thorough investigation, I'm convinced the purpose of this site is to "control" some of the message in the developer community by creating a magnet for developer frustration, interests, etc.

    That explains the continued tolerance of trolls in the community.

    Think about it. Wouldn't it make more sense to have people vent on a forum rather than taking action in other ways...such as not buying product, writing articles, talking with other developers/managers, developing your own superior product, etc.? Instead, it is much easier for people who have "issues" with MS products to come on here and discuss them, in hopes that their suggestions actually have an impact on a product, when in truth they really don't have much impact at all. The side effect of this is to then get the developer to channel the energy away from making an alternate product choice.

    Brilliant!


    Interesting thought, but full of holes.  First among them that C9, being full of (assuming valid) posts about what's wrong with MS software would be a rich place for real developers to learn strategic areas in which to compete with MS.  See the conspiracy theory assumes developers and readers of C9 are stupid.  Bad thing to assume.

  • Live Writer beta 2

    OK, trying to use this with SharePoint reports that the MetaWeblog API is not turned on.  Is this something I can do on my own blog, or is this something that has to be turned on by the SharePoint administrator?

  • Live Writer beta 2

    Sven Groot wrote:
    
    wkempf wrote:
    All dialogs pop up in the bottom right corner.  That might be a great idea for the final dialog that displays installation progress, but any dialog that prompts the user for input should be centered!  Quite annoying, and a UI design faux pas.

    I had this in Vista, but not in XP. Probably a bug.


    Maybe, but this happened to me in XP.  With both Live Writer and Live Messenger (haven't installed Live Mail yet).

  • Live Writer beta 2

    Just started installing, and I have to say, I don't like the installer!

    All dialogs pop up in the bottom right corner.  That might be a great idea for the final dialog that displays installation progress, but any dialog that prompts the user for input should be centered!  Quite annoying, and a UI design faux pas.

    Then there's the step that asks me if I want MSN as my home page and Live as my search engine.  I DESPISE installers that ask these questions.  Most people are in the habit of clicking Next all the way through installers with out reading anything in them.  This will change settings in your computer that you probably conciously chose to begin with.  It's a very rare person who will find this in an installer and think "hey, yeah, plese do that for me".  If you insist and putting this malarky in an installer as "advertisements", do the right thing and make the default be NO!

    Ah... I feel better now.  Now let's go see what this puppy can do.  Hopefully it now works with SharePoint blogs.

  • Steve Jobs: I'll see your PlayTable, and raise you iTunes Plus!

    anand.t wrote:
    I will make a wild guess, most of the guys who own an ipod + itues wont spend 30 cents more. Many actually wont know the difference and will not be interested in spending more money      


    Too bad for them.  There's still plenty of us that understand what this means and will gladly pay 30 cents more.

  • Eben Moglen predicts broad embrace of GPL 3

    What utter non-sense.  Only a radical few choose an OS because of the license.  No Windows users are going to "jump ship" because the GPL "is such a wonderful license".  And if you think the political patent restrictions added to the license will somehow cause the demise of any commercial entity, you're insane.  Further, if it somehow could, you'd see a backlash on Linux that makes the virtiol targeted at MS look like an @$$ kissing convention.  If Linux can't succeed on it's own merits, such strong arm tactics simply can't win any love from users.

    So, five years from now we'll still be waiting for the "year of the Linus desktop", and Linux may even lose some hold in the server market because of tactics like these.  So, good luck with that windmill.

  • Silverlight Meet Moonlight

    stevo_ wrote:
    So, I can write normal silver light apps, and what is being created (moonlight) is just a linux interpreter. I won't need to recompile my silverlight apps as moonlight apps and get people to download some dodgy plugin they don't know anything about.But this brings me back to not really getting it, without sound like an (I need to watch my language). I don't really care if linux users can't see my silverlight apps, and I'd assume if Microsoft was serious about silverlight anyway, that they would produce their own linux support for silverlight in the future.


    Ingoring a potential user base is stupid.  Linux users are a potential user base.  If you develop Silverlight application, you should care.

    There is still a possibility that MS will implement a Linux port, or so some blog posts *seem* to indicate.  But Moonlight will still be considered interesting to many people.  If it's not to you personally, who cares?