MediaPortal Forums HTPC/MediaCenter

Go Back   MediaPortal Forum ŧ MediaPortal 2 ŧ General Talk


General Talk Talk about MediaPortal 2.

Reply
 
LinkBack (1) Thread Tools Display Modes
Old 2008-01-06, 15:18   #11 (permalink)
Portal Member
 
Join Date: Apr 2004
Posts: 74
Thanks: 0
Thanked 1 Time in 1 Post


Send a message via ICQ to bedlam
Default

heh, browsing through the code. got it to work and all. Nice work!
This confuses me though:
SkinEngine.Controls.Button inherits from Control
SkinEngine.Controls.Visual.Button inherits from Border(why not ContentControl?) which inherits from FrameWorkElement.

Itīs the Visual Button that gets rendered right? But what does the other one do? And how are they connected?


It can be repeated again: great work!
bedlam is offline   Reply With Quote
Old 2008-01-06, 15:53   #12 (permalink)
Portal Developer
 
frodo's Avatar
 
Join Date: Apr 2004
Location: The Netherlands
Age: 36
Posts: 1,513
Thanks: 3
Thanked 119 Times in 44 Posts

Country:

My System

Default

You're right
Since a Button has a Template which defines how it should render itself
i think we can simple inherit Button from FrameWorkElement directly
frodo is offline   Reply With Quote
Old 2008-01-06, 18:25   #13 (permalink)
Portal Member
 
Join Date: Apr 2004
Posts: 74
Thanks: 0
Thanked 1 Time in 1 Post


Send a message via ICQ to bedlam
Default

Quote:
Originally Posted by frodo View Post
You're right
Since a Button has a Template which defines how it should render itself
i think we can simple inherit Button from FrameWorkElement directly
But wouldnīt inheriting from FrameWorkElement disable some scenarios ?
Like this one:
Code:
   <StackPanel>
      <StackPanel.Resources>
         <ControlTemplate x:Key="MyButtStyle" TargetType="{x:Type Button}">
            <Border
               x:Name="PART_border"
               Background="SlateGray"
               BorderBrush="Black"
               BorderThickness="1"
               CornerRadius="5">
               <ContentPresenter/>
            </Border>
            <ControlTemplate.Triggers>
               <Trigger Property="IsMouseOver" Value="True">
                  <Setter TargetName="PART_border" Property="Background" Value="#FF8CB2BD"/>
               </Trigger>
               <Trigger Property="IsPressed" Value="True">
                  <Setter TargetName="PART_border" Property="Background" Value="#FF154451"/>
                  <Setter Property="Foreground" Value="White" />
               </Trigger>
            </ControlTemplate.Triggers>
         </ControlTemplate>
      </StackPanel.Resources>
      
      <Button  Width="100" Height="75" Template="{StaticResource MyButtStyle}">
         <Grid>
            <Grid.ColumnDefinitions>
               <ColumnDefinition/>
               <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <Image Grid.Column="0" Source="http://www.freeiconsweb.com/Freeicons/256x256_Transparent_Icons2/27.png"/>
            <TextBlock Grid.Column="1" VerticalAlignment="Center" Text="Home"/>
         </Grid>
      </Button>
      
      <Button  Width="100" Height="75" Template="{StaticResource MyButtStyle}">
         <Grid>
            <Grid.ColumnDefinitions>
               <ColumnDefinition/>
               <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <Image Grid.Column="0" Source="http://www.freeiconsweb.com/Freeicons/256x256_Transparent_Icons2/35.png"/>
            <TextBlock Grid.Column="1" VerticalAlignment="Center" Text="Away"/>
         </Grid>
      </Button>
   </StackPanel>

Both buttons use the same template but have different content. If they donīt inherit from ContentControl They would have had to have two templates, since the images differ between the Buttons?

Oooor I might just be tired....

Edit: Off course one could implement a new "Content" property. But in wpf there are quite many controls that derive from ContentControl such as ListViewItem, HeaderedItemsControl and so on. The later would be great for creating dialogs and such.

Last edited by bedlam; 2008-01-06 at 18:57. Reason: added code tags
bedlam is offline   Reply With Quote
This User Say Thank You:
Old 2008-01-06, 21:05   #14 (permalink)
Portal Developer
 
frodo's Avatar
 
Join Date: Apr 2004
Location: The Netherlands
Age: 36
Posts: 1,513
Thanks: 3
Thanked 119 Times in 44 Posts

Country:

My System

Default

ok will fix this
frodo is offline   Reply With Quote
Old 2008-01-07, 19:43   #15 (permalink)
Portal Member
 
Join Date: Apr 2004
Posts: 74
Thanks: 0
Thanked 1 Time in 1 Post


Send a message via ICQ to bedlam
Default

Are you skipping the whole Attached/DependencyProperty-thing or are you planning on another equally flexible system for "distributed" properties? And if you are skipping them, wouldnīt this be a deal-breaker? If someone wanted to implement a... RadialPanel after "v1". The developer would need to make changes into UIElement,adding a property such as "Angle". Which is kind of..wrong right? When instantiating a FrameWorkElement via XAML it should be able to register a property such as RadialPanel.Angle and add to its own internal collection of DependencyProperties. this would then result in the whole Get/SetValue()-deal which many new WPF developers have abit of a struggle with, but provide much of WPFs renowned flexibility, extensibility and layout.

But perhaps what Iīve seen is temporary code, Itīs hard to know! Sorry if Iīm abit "Submit Reply"-happy here but Iīm just really psyched about this!
bedlam is offline   Reply With Quote
Old 2008-01-07, 20:03   #16 (permalink)
Project Coordinator
 
infinityloop's Avatar
 
Join Date: Dec 2004
Location: 127.0.0.1
Age: 28
Posts: 5,718
Thanks: 131
Thanked 94 Times in 65 Posts

Country:

My System

Default

Quote:
Originally Posted by bedlam View Post
But perhaps what Iīve seen is temporary code, Itīs hard to know!
the whole thing is WIP, means -> not finished.

just to let you know
__________________
regards
chris

MediaPortal Project Coordinator
Test Team Leader

Do not start to moan if something is not working as you want it to be.
Remember that MediaPortal is Open Source.
YOU can improve it!
infinityloop is online now   Reply With Quote
Old 2008-01-07, 20:50   #17 (permalink)
Portal Developer
 
frodo's Avatar
 
Join Date: Apr 2004
Location: The Netherlands
Age: 36
Posts: 1,513
Thanks: 3
Thanked 119 Times in 44 Posts

Country:

My System

Default

Quote:
Are you skipping the whole Attached/DependencyProperty-thing or are you planning on another equally flexible system for "distributed" properties?
As you see i've chosen a different approach
Yes we have dependency properties, but they are implemented differently from WPF
If someone wants to add a RadialPanel after v1.0, he can implement that class, derive it from FrameWorkElement
and put the dependency properties specific for this new RadialPanel in the RadialPanel class


Note that any new properties will be automaticly detected & handled
by the xaml parser. So without changing the core skinengine
you can add new controls and new dependency properties
to your own new controls

Frodo
frodo is offline   Reply With Quote
Old 2008-01-07, 23:09   #18 (permalink)
Portal Member
 
Join Date: Apr 2004
Posts: 74
Thanks: 0
Thanked 1 Time in 1 Post


Send a message via ICQ to bedlam
Default

[quote=infinityloop]
Quote:
just to let you know
You can consider me informed

Quote:
Originally Posted by frodo View Post
Quote:
Are you skipping the whole Attached/DependencyProperty-thing or are you planning on another equally flexible system for "distributed" properties?
As you see i've chosen a different approach
Yes we have dependency properties, but they are implemented differently from WPF
If someone wants to add a RadialPanel after v1.0, he can implement that class, derive it from FrameWorkElement
and put the dependency properties specific for this new RadialPanel in the RadialPanel class

Note that any new properties will be automaticly detected & handled
by the xaml parser. So without changing the core skinengine
you can add new controls and new dependency properties
to your own new controls

Frodo
Ah! nice to hear, that should give me a hint to look at were that kind of magic happens
Even so, it still confuses me that UIElement has these kinds of properties defined: Dock, Row, Column, rowspan and so on. Well, Iīll just have to have a look at the xamlreader(or whatever itīs called) code then.
bedlam is offline   Reply With Quote
Old 2008-01-07, 23:31   #19 (permalink)
Portal Member
 
m0deth's Avatar
 
Join Date: Dec 2006
Age: 40
Posts: 72
Thanks: 10
Thanked 2 Times in 2 Posts

Country:

My System

Send a message via ICQ to m0deth
Default

Can I assume it's possible then to have both raster and vector elements as animated elements? and if so....both onscreen at the same time, and what sort of performance hit would that be.

you could pull off some amazing things with that kind of freedom.
__________________

"an object at rest...cannot be stopped!"
m0deth is offline   Reply With Quote
Old 2008-01-08, 06:39   #20 (permalink)
Portal Developer
 
frodo's Avatar
 
Join Date: Apr 2004
Location: The Netherlands
Age: 36
Posts: 1,513
Thanks: 3
Thanked 119 Times in 44 Posts

Country:

My System

Default

Quote:
Can I assume it's possible then to have both raster and vector elements as animated elements?
Yes that will work

Quote:
and if so....both onscreen at the same time, and what sort of performance hit would that be.
That greatly depends
- on the GFX card you have, (the faster the better)
- the kind of animation(s)
- the resolution of the object you are animation
- the resolution you run MP-II (offcourse 720x576 will requires less CPU/GPU then 1920x1080)

However we do try to reach the same performance as WPF and better

Frodo
frodo is offline   Reply With Quote
Reply

Bookmarks

Tags
opensource, skinengine, xaml

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

LinkBacks (?)
LinkBack to this Thread: http://forum.team-mediaportal.com/general-talk-235/mediaportal-ii-gets-opensource-xaml-skinengine-33224/
Posted By For Type Date
Two Great WPF Video Samples Online | IRhetoric: Convergence in the Simulacrum! This thread Refback 2008-07-22 15:20

Similar Threads
Thread Thread Starter Forum Replies Last Post
MediaPortal II - Release/Roadmap/Planning James General Talk 25 2008-08-07 14:04
Announcement: MediaPortal II infinityloop General Talk 218 2008-03-07 14:41
Mediaportal-II Infinity released frodo General Talk 33 2008-01-07 18:06
Digi Vox II Problem mit Mediaportal hansen20041 Media Portal - Support 3 2006-10-30 14:15


All times are GMT +1. The time now is 11:37.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 Protected by Akismet Blog with WordPress