User Profile & Activity

Tersius Kuhne Member
Posted: April 11, 2011 4:01 AM
Hi Handy

Could you possibly give me an example of how it should be done?

Regards
T
Posted: April 6, 2011 5:11 AM

I got the separator working with the following style but I'm not sure if it is the best way to do things. Seems like overkill? Also how would I adjust the width of the button? I have tried to make the width of the "separator" smaller but that does not work. Any ideas?

<Style.Triggers>
            <DataTrigger Binding="{Binding IsSeparator}" Value="true" >
                <Setter Property="Template" >
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type Intersoft:UXDockButton}">
                            <Grid x:Name="RootElement">
                                <VisualStateManager.VisualStateGroups>
                                    <VisualStateGroup x:Name="CommonStates">
                                        <VisualStateGroup.Transitions>
                                            <VisualTransition From="{x:Null}" GeneratedDuration="0:0:0.05" GeneratedEasingFunction="{x:Null}" Storyboard="{x:Null}" To="{x:Null}"/>
                                            <VisualTransition From="{x:Null}" GeneratedDuration="0:0:0.3" GeneratedEasingFunction="{x:Null}" Storyboard="{x:Null}" To="Normal"/>
                                        </VisualStateGroup.Transitions>
                                        <VisualState x:Name="Normal"/>
                                        <VisualState x:Name="MouseOver"/>
                                        <VisualState x:Name="Pressed"/>
                                        <VisualState x:Name="HighlightFocused"/>
                                        <VisualState x:Name="Checked"/>
                                        <VisualState x:Name="Disabled">
                                            <Storyboard>
                                                <DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="DisabledVisualElement"/>
                                            </Storyboard>
                                        </VisualState>
                                    </VisualStateGroup>
                                    <VisualStateGroup x:Name="FocusStates">
                                        <VisualState x:Name="Focused"/>
                                        <VisualState x:Name="Unfocused"/>
                                    </VisualStateGroup>
                                    <VisualStateGroup x:Name="KeyboardFocusStates">
                                        <VisualState x:Name="KeyboardUnfocused"/>
                                        <VisualState x:Name="KeyboardFocused">
                                            <Storyboard>
                                                <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="KeyboardFocus">
                                                    <DiscreteObjectKeyFrame KeyTime="0">
                                                        <DiscreteObjectKeyFrame.Value>
                                                            <Visibility>Visible</Visibility>
                                                        </DiscreteObjectKeyFrame.Value>
                                                    </DiscreteObjectKeyFrame>
                                                </ObjectAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </VisualState>
                                    </VisualStateGroup>
                                    <!--<VisualStateGroup x:Name="TooltipStates">
                                        <VisualStateGroup.Transitions>
                                            <VisualTransition From="{x:Null}" GeneratedDuration="0:0:0.1" GeneratedEasingFunction="{x:Null}" Storyboard="{x:Null}" To="{x:Null}"/>
                                        </VisualStateGroup.Transitions>
                                        <VisualState x:Name="TooltipShow">
                                            <Storyboard>
                                                <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="TooltipElement"/>
                                            </Storyboard>
                                        </VisualState>
                                        <VisualState x:Name="TooltipHide">
                                            <Storyboard>
                                                <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="TooltipElement"/>
                                            </Storyboard>
                                        </VisualState>
                                    </VisualStateGroup>-->
                                </VisualStateManager.VisualStateGroups>
                                <MediaElement x:Name="AudioElement" Position="0" SpeedRatio="1"/>
                                <Border x:Name="OuterBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="{TemplateBinding CornerRadius}"/>
                                <Border x:Name="AnimationElement" BorderThickness="1" CornerRadius="{TemplateBinding CornerRadius}" Opacity="0"/>
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition/>
                                        <RowDefinition/>
                                    </Grid.RowDefinitions>
                                    <Ellipse x:Name="GlowElement" Fill="{TemplateBinding GlowingEffectColor}" HorizontalAlignment="Stretch" Opacity="1" VerticalAlignment="Stretch" Panel.ZIndex="-1"/>
                                </Grid>
                                <Border x:Name="Glass" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding GlassBackground}" CornerRadius="{TemplateBinding CornerRadius}" Margin="1"/>
                                <Border x:Name="InnerBorder" BorderBrush="#BFFFFFFF" CornerRadius="{TemplateBinding InnerCornerRadius}" Margin="{TemplateBinding BorderThickness}" Visibility="{TemplateBinding InnerBorderVisibility}"/>
                                <Intersoft:StylishLabel x:Name="TooltipElement" BorderBrush="{x:Null}" Background="#99000000" Content="{TemplateBinding Text}" CornerRadius="8" Foreground="White" FontSize="16" HorizontalAlignment="Center" IsHitTestVisible="False" Opacity="0" Padding="8,2" VerticalAlignment="Center"/>
                                <Grid>
                                    <Border x:Name="StackMenuContainer"/>
                                    <Intersoft:ContentReflector x:Name="ContentReflector" EnableReflection="{TemplateBinding EnableReflection}" ReflectionVisibility="{TemplateBinding ReflectionVisibility}" ReflectionPosition="{TemplateBinding ReflectionPosition}" ReflectionSource="{TemplateBinding Icon}">
                                        <Grid x:Name="ContentContainer">
                                            <Intersoft:ImageLoader x:Name="ImageElement" />
                                            <Intersoft:StylishLabel x:Name="StylishLabel" />
                                            <Intersoft:UXDockSeparator Height="120" Orientation="Vertical"/>
                                            <!--<Intersoft:ImageLoader x:Name="ImageElement" Height="{TemplateBinding ImageHeight}" ImageSource="{TemplateBinding Icon}" ProgressBarHorizontalAlignment="Stretch" ProgressBarVerticalAlignment="Bottom" ProgressTextVisibility="{TemplateBinding ImageLoaderTextVisibility}" ProgressBarMargin="15,0,15,14" UseLoader="{TemplateBinding UseImageLoader}" Width="{TemplateBinding ImageWidth}"/>
                                    <Intersoft:StylishLabel x:Name="StylishLabel" BorderBrush="{x:Null}" Background="{x:Null}" ContentType="{TemplateBinding DisplayMode}" Content="{TemplateBinding Content}" Effect="{x:Null}" Foreground="{TemplateBinding Foreground}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" ImageMargin="0" ImageWidth="{TemplateBinding ImageWidth}" ImageSource="{TemplateBinding Icon}" ImageHeight="{TemplateBinding ImageHeight}" Margin="{TemplateBinding Padding}" Padding="0" TextImageRelation="{TemplateBinding TextImageRelation}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>-->
                                        </Grid>
                                    </Intersoft:ContentReflector>
                                    <Intersoft:ContentReflector x:Name="StackIndicatorElement" AutoRefresh="False" EnableReflection="{TemplateBinding EnableReflection}" ReflectionVisibility="{TemplateBinding ReflectionVisibility}" ReflectionPosition="{TemplateBinding ReflectionPosition}" ReflectionSource="{TemplateBinding StackIndicatorSource}" Visibility="Collapsed">
                                        <Intersoft:ImageLoader x:Name="StackIndicatorImageElement" ImageSource="{TemplateBinding StackIndicatorSource}" ProgressBarHorizontalAlignment="Stretch" ProgressBarVerticalAlignment="Bottom" ProgressTextVisibility="{TemplateBinding ImageLoaderTextVisibility}" ProgressBarMargin="15,0,15,14" UseLoader="{TemplateBinding UseImageLoader}"/>
                                    </Intersoft:ContentReflector>
                                </Grid>
                                <Grid x:Name="IndicatorElement" HorizontalAlignment="Center" VerticalAlignment="Center">
                                    <Image x:Name="IndicatorImageElement" Height="{TemplateBinding IndicatorHeight}" Margin="{TemplateBinding IndicatorOffset}" Width="{TemplateBinding IndicatorWidth}"/>
                                </Grid>
                                <Border x:Name="DisabledVisualElement" Background="White" CornerRadius="{TemplateBinding CornerRadius}" IsHitTestVisible="False" Opacity="0"/>
                                <Rectangle x:Name="KeyboardFocus" IsHitTestVisible="False" Margin="2" RadiusY="{TemplateBinding CornerRadiusDouble}" RadiusX="{TemplateBinding CornerRadiusDouble}" Stroke="#FF747474" StrokeDashArray="1 1" Visibility="Collapsed"/>
                                <Border x:Name="FocusVisualElement" BorderBrush="#00156174" BorderThickness="1" CornerRadius="{TemplateBinding CornerRadius}" IsHitTestVisible="False"/>
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </DataTrigger>
        </Style.Triggers>

 

Posted: April 5, 2011 9:35 AM

Hi

Thanks for the updated bins. I now have another issue. I need to add separators in the dock. I have added a datatemplate to the UxDockButton and the separator is created, but when I hover over the separator with my mouse an object null reference exception is thrown..

It seems that there is some kind of mouse over event that gets raised and then causes the exception.

If this is not the way to add a dynamic separator, based on the actual bound item please adivse how it can be done.

<Style x:Key="UXDockButtonStyle1" TargetType="Intersoft:UXDockButton">
        <Setter Property="StackMenuStyle" Value="{StaticResource UXStackMenuStyle1}"/>
        <Setter Property="Command" Value="{Binding MenuClickCommand}"/>
        <Setter Property="CommandParameter" Value="{Binding }"/>
        <Style.Triggers>
            <DataTrigger Binding="{Binding IsSeparator}" Value="true" >
                <Setter Property="Template" >
                    <Setter.Value>
                        <ControlTemplate>                            
                                <Intersoft:UXDockSeparator Orientation="Vertical"/>                             
                        </ControlTemplate>
                    </Setter.Value>                    
                </Setter>          
            </DataTrigger>
        </Style.Triggers>
</Style>

 Also how would one change the tooltip font when you hover over the icon?

Posted: March 22, 2011 3:32 AM

Hi

When is the next release due? I would appreciate a hotfix a.s.a.p so that I can go on with my development.

Thanks

Posted: March 17, 2011 6:57 AM

Hi Martin 


Thanks for the project. Unfortunately my project is a WPF project. I had a look at the code and it looks the same as my WPF project code. Would it be possible to provide me with a WPF version of the code you provided?

Edit : I have updated my solution to include a silverlight copy with the exact same code and in the silverlight project everything works fine... So it seems there is a bug in the WPF libraries or I'm doing something wrong. Please have a look.


Regards

Posted: March 16, 2011 10:36 AM

Hi


I have attached an example that I'm trying to get working. I have created an Image folder and put my image under that but the subitems are still not working even after changing to the semi pack notation you mentioned.


Also if I create a style(with blend) for the buttons the application throws an exception...I did not change the style at all. 

All times are GMT -5. The time now is 7:08 AM.
Previous Next