Results 1 to 5 of 5

Thread: WPF ui performance question

  1. #1

    Thread Starter
    Fanatic Member Megalith's Avatar
    Join Date
    Oct 2006
    Location
    Secret location in the UK
    Posts
    879

    WPF ui performance question

    hi all,

    wonder if anyone has any advice regarding the best approach to an issue i have with my year long wpf project i'm refactoring (well more a case of understanding what wpf is and what isn't winforms and writing as my understanding increases).

    So as not to get took down a specific route i will generalise my control's purpose. I have a uielement which is broken into a grid of 128 columns and 10 rows, the last 3 rows are offset by 1/2 a cells width. each cell contains no more than 2 characters and is coloured according to the value in it, the entire element can move left or right within a clipped uielement and each cell of the nested uielement needs to have tooltips associated with each cell that contain editable text that is edited by right clicking it (left clicking positions the element in the center of the viewing area, which has a box enlosing this selected column of data).

    Ok my first attempt was to use labels absolutely positioned (as i would do with winforms) and redraw all visible labels. this worked but is entirely in code behind and is not wpf style.

    My next attempt was to use stack panels for the upper and lower regions and to place the labels within vertical stackpanels placing the entire object into a canvas and then nesting that canvas within one i have on the xaml file, this again was done in code behind and is proving to be a nightmare now i need to have editable tooltips too.

    My current thinking is to have a tooltip array and use hit testing to determine what on the canvas has been clicked or perhaps to position labels on the canvas in the ui and edit the text/background colours with code behind.

    I wish to abstract the ui from the code in a MVVM way, what would you guys think is the way to tackle this one? i am using VB.Net within vs 2010 pro
    If debugging is the process of removing bugs, then programming must be the process of putting them in.

  2. #2
    Frenzied Member Lightning's Avatar
    Join Date
    Oct 2002
    Location
    Eygelshoven
    Posts
    1,611

    Re: WPF ui performance question

    Why don't you create the grid with a fixed position textboxs and set the binding-path for each textbox and the background with a WPF convertor (you must see these thing, they are real real powerfull).
    VB6 & C# (WCF LINQ) mostly


    If you need help with a WPF/WCF question post in the NEW WPF & WCF forum and we will try help the best we can

    My site

    My blog, couding troubles and solutions

    Free online tools

  3. #3

    Thread Starter
    Fanatic Member Megalith's Avatar
    Join Date
    Oct 2006
    Location
    Secret location in the UK
    Posts
    879

    Re: WPF ui performance question

    Hi lightning,

    the grid idea throws one initial issue to me, the bottom lines are offset i could fix this (i think) by doubling the number of columns and making each textbox/label take up 2 cells.

    I should explain more about the tooltips bit, i wish to have an ability where when i hover over an item a tooltip type object appears that can be edited, not the contents of the cell, like a notes ability. similar to inline editable floating text like you can get with ajax. I believe i can make a tooltip contain a form of sorts?

    its a bit daunting the prospect of adding 1000+ labels manually to a canvas, are there shortcuts to this (besides cutting and pasting) which can keep the names of each cell in a format i can access from the code. To get total control of position and names of these label elements would my best option be to write a small app that creates a xaml file i could cut and paste into my project?
    If debugging is the process of removing bugs, then programming must be the process of putting them in.

  4. #4
    Frenzied Member Lightning's Avatar
    Join Date
    Oct 2002
    Location
    Eygelshoven
    Posts
    1,611

    Re: WPF ui performance question

    Why don't you use a combobox? You can create a itemtemple for 1 item which will be used for all items.
    VB6 & C# (WCF LINQ) mostly


    If you need help with a WPF/WCF question post in the NEW WPF & WCF forum and we will try help the best we can

    My site

    My blog, couding troubles and solutions

    Free online tools

  5. #5

    Thread Starter
    Fanatic Member Megalith's Avatar
    Join Date
    Oct 2006
    Location
    Secret location in the UK
    Posts
    879

    Re: WPF ui performance question

    Quote Originally Posted by Lightning View Post
    Why don't you use a combobox? You can create a itemtemple for 1 item which will be used for all items.
    oh thats a good idea with the itemtemplate containing displayed text an editable on right click textregion which is displayed on hover as a tooltip (if one exists). gotta love what you can do with wpf. will create this as a user control. got lots of ideas running through my mind.
    If debugging is the process of removing bugs, then programming must be the process of putting them in.

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