mystery of the missing controls (Win8 theme bug)

3 posts, 1 answers
  1. kity
    kity avatar
    71 posts
    Member since:
    Mar 2012

    Posted 20 Aug 2013 Link to this post

    N.B. Framework 4.5

    // first in Application  App.cs set at runtime theme windows8
    protected override void OnStartup(StartupEventArgs e)
    {           
        StyleManager.ApplicationTheme = new Windows8Theme();                   
    }

    // Then create two VIEW

    // First is MASTER_VIEW
    // ADD XAML
      <telerik:RadTabControl Grid.Row="0" >

                <telerik:RadTabItem DropDownContent="Trend Import" Header="DETAIL" >
                    <telerik:RadTabItem.Content>
                        <views:DETAIL_VIEW/>
                    </telerik:RadTabItem.Content>
                </telerik:RadTabItem>

    </telerik:RadTabControl>

    // ADD SECOND XAML -> DETAIL_VIEW
    <Grid>

       <GroupBox Header="tyy tyy" >
               <TextBlock Text="Settings"/> 
        </GroupBox>
     </Grid>
          
    Build and run WPF APPLICATION

    TextBlock is not visible. Cannot see content(Text) of any TextBlock controls?
    I use default style at all.

    Workaround:
    Remove: OnStartup(StartupEventArgs e) function, stay at default theme.
    You will see all textblock controls again.

    Additional info: This bug depends and others controls like GroupBox and others.

    Framework 4.5
    VS2012

    Telerik v. 2013.2.611.45 (For framework 4.5)

    This is styles that I use. In comment is second workaround.

                        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      
        <ControlTemplate x:Key="TextBoxErrorTemplate">
            <DockPanel LastChildFill="True" >
                <Border BorderBrush="Red" BorderThickness="1" >
                    <AdornedElementPlaceholder x:Name="Holder"  />
                </Border>
                <Label  Foreground="White" Content="{Binding ElementName=Holder, Path=AdornedElement.(Validation.Errors)[0].ErrorContent}" BorderThickness="1" BorderBrush="White" Background="Red" UseLayoutRounding="True"  />
            </DockPanel>
        </ControlTemplate>
      
          
        <Style TargetType="Button"
                <Style.Triggers>
                    <Trigger Property="Validation.HasError" Value="true">
                        <Setter Property="IsEnabled" Value="False"/>                                        
                    </Trigger>
                    <Trigger Property="Validation.HasError" Value="false">
                        <Setter Property="IsEnabled" Value="True"/>                     
                    </Trigger>                
                </Style.Triggers>
        </Style>
      
        <Style x:Key="LinkButton" TargetType="Button">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <TextBlock TextDecorations="Underline">
                        <ContentPresenter />
                        </TextBlock>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Setter Property="Foreground" Value="Blue" />
            <Setter Property="Cursor" Value="Hand" />
            <Style.Triggers>
                <Trigger Property="IsMouseOver" Value="true">
                    <Setter Property="Foreground" Value="Red" />
                </Trigger>
            </Style.Triggers>
        </Style>
      
     <!--
        <Style TargetType="TextBlock">
            <Setter Property="Foreground" Value="#FF151515" />       
        </Style>
      
        <Style TargetType="GroupBox">
            <Setter Property="Foreground" Value="#FF151515" />
        </Style>
    -->
          
    </ResourceDictionary>
         


                        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >
      
        
      
        <Style x:Key="LinkButtonStyle" TargetType="{x:Type Button}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <TextBlock TextDecorations="Underline">
                            <ContentPresenter />
                        </TextBlock>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Setter Property="HorizontalContentAlignment" Value="Center"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="Foreground" Value="Blue" />
            <Setter Property="Cursor" Value="Hand" />
            <Style.Triggers>
                <Trigger Property="IsMouseOver" Value="true">
                    <Setter Property="Foreground" Value="Red" />
                </Trigger>
            </Style.Triggers>
        </Style>
      
    </ResourceDictionary>
  2. Answer
    Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 23 Aug 2013 Link to this post

    Hi Petar,

     We are aware of this issue and it will be fixed in the Q3 2013 Official Release. As a workaround, you can set the Foreground of the elements you don't see explicitly.

    Regards,
    Petar Mladenov
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. kity
    kity avatar
    71 posts
    Member since:
    Mar 2012

    Posted 23 Sep 2013 Link to this post

    thank you

     

    already did that.

Back to Top