locked
MVC arhitecture. (Lasse) - 9/13/2007 6:16 AM PST RRS feed

  • Question

  • By: Lasse


    Hi.
    I'm writing a application using the MVC arhitecture. Much of my business
    and data access logic is already written.

    For the GUI I planned to use Blend. Specially the graphical way to connect
    controls to data sourcese,, appeals to me. It seems easy to do attractive
    interfaces whitout to much iterations between graphical and code design.

    In Blend I creates a CLR data source, named xxxDS, which is the base for
    databinding and creating nice looking controls.

    My question is,,, assuming that you have this CLR object defined by Blend in
    XAML (xxxDS), what is the best way to connect the object to your business
    logic.

    Seraching internet I have found a couple suggestions, but would really have
    a good suggestion from this forum.

    //regards
    //lasse

    Thursday, February 21, 2008 6:09 PM

All replies

  • By: Fred

    Greetings
    Frederik
    http://wpf-tutorials.livejournal.com/


    "Lasse" <Lasse@discussions.microsoft.com> wrote in message
    news:6ACF388B-6DF4-46CE-86FD-408FFED1D200@microsoft.com...
    > Hi.
    > I'm writing a application using the MVC arhitecture. Much of my business
    > and data access logic is already written.
    >
    > For the GUI I planned to use Blend. Specially the graphical way to connect
    > controls to data sourcese,, appeals to me. It seems easy to do attractive
    > interfaces whitout to much iterations between graphical and code design.
    >
    > In Blend I creates a CLR data source, named xxxDS, which is the base for
    > databinding and creating nice looking controls.
    >
    > My question is,,, assuming that you have this CLR object defined by Blend
    > in
    > XAML (xxxDS), what is the best way to connect the object to your business
    > logic.
    >
    > Seraching internet I have found a couple suggestions, but would really
    > have
    > a good suggestion from this forum.
    >
    > //regards
    > //lasse
    >
    >
    >
    >
    >
    Thursday, February 21, 2008 10:13 PM
  • By: Corrado Cavalli [MVP]

    If you want to implement a good MVP pattern you have to remove the
    ObjectDataProvider that Blends creates and, as suggested by Fred, provide
    the data externally via DataContext or, better, through a property of the
    IView interface implemented by the WPF Window.
    Unfortunately, if you do this, editing the datatemplate for you data becomes
    harder because Blend has no idea of waht data it has to "shape"

    HTH

    --
    Corrado Cavalli [Microsoft .NET MVP-MCP]
    UGIdotNET -
    http://www.ugidotnet.org
    Weblog: http://blogs.ugidotnet.org/corrado/
    Thursday, February 21, 2008 10:15 PM
  • By: Lasse

    I was afraid of that,,, Is there not a DataType property for the 
    DataTemplate. Cant Blend use it?
    
    //lg
    
    
    
    
    "Corrado Cavalli [MVP]" wrote:
    
    > If  you want to implement a good MVP pattern you have to remove the 
    > ObjectDataProvider that Blends creates and, as suggested by Fred, provide 
    > the data externally via DataContext or, better, through a property of the 
    > IView interface implemented by the WPF Window.
    > Unfortunately, if you do this, editing the datatemplate for you data becomes 
    > harder because Blend has no idea of waht data it has to "shape"
    > 
    > HTH
    > 
    > -- 
    > Corrado Cavalli [Microsoft .NET MVP-MCP]
    > UGIdotNET - http://www.ugidotnet.org
    > Weblog: http://blogs.ugidotnet.org/corrado/ 
    > 
    > 
    Thursday, February 21, 2008 10:17 PM
  • By: Corrado Cavalli [MVP]

    From my tests Datatemplate works only if Blend (at design time) can describe
    the type you're "shaping" otherwise you have to create it manually (but
    DataTemplate size remains very small)

    --
    Corrado Cavalli [Microsoft .NET MVP-MCP]
    UGIdotNET -
    http://www.ugidotnet.org
    Weblog: http://blogs.ugidotnet.org/corrado/
    Thursday, February 21, 2008 10:18 PM