J'ai un style de fenêtre WPF défini ainsi:WPF - Comment afficher du texte sur chaque écran
<Style
x:Key="Applet"
TargetType="{x:Type Window}">
<Setter
Property="WindowStyle"
Value="None" />
<Setter
Property="WindowState"
Value="Maximized" />
<Setter
Property="Title"
Value="Hindenburg" />
<Setter
Property="FontFamily"
Value="Arial" />
<Setter
Property="Height"
Value="650" />
<Setter
Property="Width"
Value="850" />
</Style>
Mon application définit ensuite plusieurs écrans en utilisant ce style (FlowWindow est juste dérivé de la fenêtre avec quelques bits supplémentaires) :
<uControl:FlowWindow
x:Class="KaleidoscopeApplication.DisposablesScan"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:u="clr-namespace:KaleidoscopeApplication"
xmlns:uControl="clr-namespace:KaleidoscopeApplication.Controls"
Style="{StaticResource Applet}"
Loaded="disposablesScanWindow_Loaded"
Unloaded="disposablesScanWindow_Unloaded">
<Canvas>
<!-- Top Bar Background -->
<Image
Source="Resources/Elements/Backgrounds/16.png" />
text etc etc...
</Canvas>
Ma question - Comment définir un bloc de texte qui sera affiché sur chaque fenêtre utilisant ce style? Par exemple, si je veux un logo affiché dans le coin supérieur droit de chaque écran ...
Puisque le style définit des choses comme la taille et la police et non le contenu de la toile, je ne sais pas comment s'y prendre ce.
Merci d'avance!
EDIT: FlowWindow n'est pas un UserControl. C'est juste une partie de mon espace de noms KaleidoscopeApplication.Controls. Il est défini comme:
public class FlowWindow : Window
{
public FlowWindow()
: base()
{ }
/// <summary>
/// Transition smoothly to another FlowWindow.
/// </summary>
/// <param name="toWindow">The window to transtion to.</param>
public override void Transition(FlowWindow toWindow)
{
...
}
}
Quels sont les "bits supplémentaires" qui composent le FlowWindow? Est-ce vraiment un contrôle utilisateur (comme votre préfixe l'indique), ou est-ce un contrôle personnalisé, avec un fichier generic.xaml associé? –
Ajout d'informations sur FlowWindow ... – BabaBooey