IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Windows Presentation Foundation Discussion :

Theme Aero pour application WPF


Sujet :

Windows Presentation Foundation

  1. #1
    Nouveau membre du Club
    Inscrit en
    Février 2008
    Messages
    45
    Détails du profil
    Informations forums :
    Inscription : Février 2008
    Messages : 45
    Points : 36
    Points
    36
    Par défaut Theme Aero pour application WPF
    Bonjour,

    J'essai d'appliquer le théme Aero sur mon appli WPF. j'ai regardé sur ton Blog Thomas

    J'ai bien rajouté le code dans mes ressources, seulement maintenant j'ai cette erreur :


    Cannot add content directly to this ResourceDictionary because its Source property has already been set. Error at object 'System.Windows.ResourceDictionary' in markup file 'WPFMwiWindows;component/mainwindow.xaml' Line 12 Position 29.

    voilà mon code
    Code xml : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
     
    xmlns:d="http://schemas.microsoft.com/expression/blend/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
        xmlns:Control="clr-namespace:WPFMwiWindows.Controls" 
        xmlns:Win="clr-namespace:WPFMwiWindows"   
        xmlns:Tools="clr-namespace:Syncfusion.Windows.Tools.Controls;assembly=Syncfusion.Tools.WPF"
     
        Title="FuturMaster" Height="600" Width="600">
        <Window.Resources>
            <ResourceDictionary Source="/PresentationFramework.Aero, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, ProcessorArchitecture=MSIL;component/themes/aero.normalcolor.xaml" >
                <XmlDataProvider x:Key="menuDonneeProvider" Source="F:\GUI\WPFMwiWindows_Src\WPFMwiWindows\Xml\MenuDonnees.xml" XPath="/Menu/Donnee" />
                <XmlDataProvider x:Key="menuPrevisionProvider" Source="F:\GUI\WPFMwiWindows_Src\WPFMwiWindows\Xml\MenuDonnees.xml" XPath="/Menu/Prevision" />
                <XmlDataProvider x:Key="menuBudgetProvider" Source="F:\GUI\WPFMwiWindows_Src\WPFMwiWindows\Xml\MenuDonnees.xml" XPath="/Menu/Budget" />
                <XmlDataProvider x:Key="menuPrevComProvider" Source="F:\GUI\WPFMwiWindows_Src\WPFMwiWindows\Xml\MenuDonnees.xml" XPath="/Menu/PrevCom" />
                <XmlDataProvider x:Key="menuGestionDesPromoProvider" Source="F:\GUI\WPFMwiWindows_Src\WPFMwiWindows\Xml\MenuDonnees.xml" XPath="/Menu/GestionPromo" />
                <XmlDataProvider x:Key="menuReportingProvider" Source="F:\GUI\WPFMwiWindows_Src\WPFMwiWindows\Xml\MenuDonnees.xml" XPath="/Menu/Reportin" />
                <XmlDataProvider x:Key="menuADDProvider" Source="F:\GUI\WPFMwiWindows_Src\WPFMwiWindows\Xml\MenuDonnees.xml" XPath="/Menu/ADD" />
                <XmlDataProvider x:Key="menuConfigProvider" Source="F:\GUI\WPFMwiWindows_Src\WPFMwiWindows\Xml\MenuDonnees.xml" XPath="/Menu/Config" />
                <XmlDataProvider x:Key="menuFenetreProvider" Source="F:\GUI\WPFMwiWindows_Src\WPFMwiWindows\Xml\MenuDonnees.xml" XPath="/Menu/Fenetre" />
                <XmlDataProvider x:Key="menuVueProvider" Source="F:\GUI\WPFMwiWindows_Src\WPFMwiWindows\Xml\MenuDonnees.xml" XPath="/Menu/Vue" />
                <XmlDataProvider x:Key="menuAideProvider" Source="F:\GUI\WPFMwiWindows_Src\WPFMwiWindows\Xml\MenuDonnees.xml" XPath="/Menu/Aide" />
     
    </ResourceDictionary> 
    </Window.Resources>

    Quel est le probléme?

    Merci pour ton aide
    Amandine

  2. #2
    Rédacteur
    Avatar de Thomas Lebrun
    Profil pro
    Inscrit en
    Octobre 2002
    Messages
    9 161
    Détails du profil
    Informations personnelles :
    Âge : 41
    Localisation : France

    Informations forums :
    Inscription : Octobre 2002
    Messages : 9 161
    Points : 19 434
    Points
    19 434
    Par défaut
    Il faut que tu enlèves cette ligne:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    <ResourceDictionary Source="/PresentationFramework.Aero, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, ProcessorArchitecture=MSIL;component/themes/aero.normalcolor.xaml" >
    Et que tu la remplaces par un MergeDictionnary:

    Code xml : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
     
    <Window.Resources>
            <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
              <ResourceDictionary Source="/PresentationFramework.Aero, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, ProcessorArchitecture=MSIL;component/themes/aero.normalcolor.xaml" >
            </ResourceDictionary.MergedDictionaries>
          </ResourceDictionary>
     
                <XmlDataProvider x:Key="menuDonneeProvider" Source="F:\GUI\WPFMwiWindows_Src\WPFMwiWindows\Xml\MenuDonnees.xml" XPath="/Menu/Donnee" />
                <XmlDataProvider x:Key="menuPrevisionProvider" Source="F:\GUI\WPFMwiWindows_Src\WPFMwiWindows\Xml\MenuDonnees.xml" XPath="/Menu/Prevision" />
                <XmlDataProvider x:Key="menuBudgetProvider" Source="F:\GUI\WPFMwiWindows_Src\WPFMwiWindows\Xml\MenuDonnees.xml" XPath="/Menu/Budget" />
                <XmlDataProvider x:Key="menuPrevComProvider" Source="F:\GUI\WPFMwiWindows_Src\WPFMwiWindows\Xml\MenuDonnees.xml" XPath="/Menu/PrevCom" />
                <XmlDataProvider x:Key="menuGestionDesPromoProvider" Source="F:\GUI\WPFMwiWindows_Src\WPFMwiWindows\Xml\MenuDonnees.xml" XPath="/Menu/GestionPromo" />
                <XmlDataProvider x:Key="menuReportingProvider" Source="F:\GUI\WPFMwiWindows_Src\WPFMwiWindows\Xml\MenuDonnees.xml" XPath="/Menu/Reportin" />
                <XmlDataProvider x:Key="menuADDProvider" Source="F:\GUI\WPFMwiWindows_Src\WPFMwiWindows\Xml\MenuDonnees.xml" XPath="/Menu/ADD" />
                <XmlDataProvider x:Key="menuConfigProvider" Source="F:\GUI\WPFMwiWindows_Src\WPFMwiWindows\Xml\MenuDonnees.xml" XPath="/Menu/Config" />
                <XmlDataProvider x:Key="menuFenetreProvider" Source="F:\GUI\WPFMwiWindows_Src\WPFMwiWindows\Xml\MenuDonnees.xml" XPath="/Menu/Fenetre" />
                <XmlDataProvider x:Key="menuVueProvider" Source="F:\GUI\WPFMwiWindows_Src\WPFMwiWindows\Xml\MenuDonnees.xml" XPath="/Menu/Vue" />
                <XmlDataProvider x:Key="menuAideProvider" Source="F:\GUI\WPFMwiWindows_Src\WPFMwiWindows\Xml\MenuDonnees.xml" XPath="/Menu/Aide" />
    </Window.Resources>

  3. #3
    Nouveau membre du Club
    Inscrit en
    Février 2008
    Messages
    45
    Détails du profil
    Informations forums :
    Inscription : Février 2008
    Messages : 45
    Points : 36
    Points
    36
    Par défaut
    il y avait une petite erreur dans ton code(fermeture de ResourceDictionary aprés les xmlProvider) comme ça ça marche bien :
    Merci pour ton aide
    Code xml : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
     
    <Window.Resources>
            <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
              <ResourceDictionary Source="/PresentationFramework.Aero, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, ProcessorArchitecture=MSIL;component/themes/aero.normalcolor.xaml" >
            </ResourceDictionary.MergedDictionaries>
     
     
                <XmlDataProvider x:Key="menuDonneeProvider" Source="F:\GUI\WPFMwiWindows_Src\WPFMwiWindows\Xml\MenuDonnees.xml" XPath="/Menu/Donnee" />
                <XmlDataProvider x:Key="menuPrevisionProvider" Source="F:\GUI\WPFMwiWindows_Src\WPFMwiWindows\Xml\MenuDonnees.xml" XPath="/Menu/Prevision" />
                <XmlDataProvider x:Key="menuBudgetProvider" Source="F:\GUI\WPFMwiWindows_Src\WPFMwiWindows\Xml\MenuDonnees.xml" XPath="/Menu/Budget" />
                <XmlDataProvider x:Key="menuPrevComProvider" Source="F:\GUI\WPFMwiWindows_Src\WPFMwiWindows\Xml\MenuDonnees.xml" XPath="/Menu/PrevCom" />
                <XmlDataProvider x:Key="menuGestionDesPromoProvider" Source="F:\GUI\WPFMwiWindows_Src\WPFMwiWindows\Xml\MenuDonnees.xml" XPath="/Menu/GestionPromo" />
                <XmlDataProvider x:Key="menuReportingProvider" Source="F:\GUI\WPFMwiWindows_Src\WPFMwiWindows\Xml\MenuDonnees.xml" XPath="/Menu/Reportin" />
                <XmlDataProvider x:Key="menuADDProvider" Source="F:\GUI\WPFMwiWindows_Src\WPFMwiWindows\Xml\MenuDonnees.xml" XPath="/Menu/ADD" />
                <XmlDataProvider x:Key="menuConfigProvider" Source="F:\GUI\WPFMwiWindows_Src\WPFMwiWindows\Xml\MenuDonnees.xml" XPath="/Menu/Config" />
                <XmlDataProvider x:Key="menuFenetreProvider" Source="F:\GUI\WPFMwiWindows_Src\WPFMwiWindows\Xml\MenuDonnees.xml" XPath="/Menu/Fenetre" />
                <XmlDataProvider x:Key="menuVueProvider" Source="F:\GUI\WPFMwiWindows_Src\WPFMwiWindows\Xml\MenuDonnees.xml" XPath="/Menu/Vue" />
                <XmlDataProvider x:Key="menuAideProvider" Source="F:\GUI\WPFMwiWindows_Src\WPFMwiWindows\Xml\MenuDonnees.xml" XPath="/Menu/Aide" />
    </ResourceDictionary>
    </Window.Resources>

  4. #4
    Candidat au Club
    Profil pro
    Développeur informatique
    Inscrit en
    Septembre 2007
    Messages
    3
    Détails du profil
    Informations personnelles :
    Âge : 38
    Localisation : France, Pyrénées Atlantiques (Aquitaine)

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Septembre 2007
    Messages : 3
    Points : 4
    Points
    4
    Par défaut
    Code xml : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
     
    <Window.Resources>
            <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
              <ResourceDictionary Source="/PresentationFramework.Aero, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, ProcessorArchitecture=MSIL;component/themes/aero.normalcolor.xaml" />
            </ResourceDictionary.MergedDictionaries>
     
     
                <XmlDataProvider x:Key="menuDonneeProvider" Source="F:\GUI\WPFMwiWindows_Src\WPFMwiWindows\Xml\MenuDonnees.xml" XPath="/Menu/Donnee" />
                <XmlDataProvider x:Key="menuPrevisionProvider" Source="F:\GUI\WPFMwiWindows_Src\WPFMwiWindows\Xml\MenuDonnees.xml" XPath="/Menu/Prevision" />
                <XmlDataProvider x:Key="menuBudgetProvider" Source="F:\GUI\WPFMwiWindows_Src\WPFMwiWindows\Xml\MenuDonnees.xml" XPath="/Menu/Budget" />
                <XmlDataProvider x:Key="menuPrevComProvider" Source="F:\GUI\WPFMwiWindows_Src\WPFMwiWindows\Xml\MenuDonnees.xml" XPath="/Menu/PrevCom" />
                <XmlDataProvider x:Key="menuGestionDesPromoProvider" Source="F:\GUI\WPFMwiWindows_Src\WPFMwiWindows\Xml\MenuDonnees.xml" XPath="/Menu/GestionPromo" />
                <XmlDataProvider x:Key="menuReportingProvider" Source="F:\GUI\WPFMwiWindows_Src\WPFMwiWindows\Xml\MenuDonnees.xml" XPath="/Menu/Reportin" />
                <XmlDataProvider x:Key="menuADDProvider" Source="F:\GUI\WPFMwiWindows_Src\WPFMwiWindows\Xml\MenuDonnees.xml" XPath="/Menu/ADD" />
                <XmlDataProvider x:Key="menuConfigProvider" Source="F:\GUI\WPFMwiWindows_Src\WPFMwiWindows\Xml\MenuDonnees.xml" XPath="/Menu/Config" />
                <XmlDataProvider x:Key="menuFenetreProvider" Source="F:\GUI\WPFMwiWindows_Src\WPFMwiWindows\Xml\MenuDonnees.xml" XPath="/Menu/Fenetre" />
                <XmlDataProvider x:Key="menuVueProvider" Source="F:\GUI\WPFMwiWindows_Src\WPFMwiWindows\Xml\MenuDonnees.xml" XPath="/Menu/Vue" />
                <XmlDataProvider x:Key="menuAideProvider" Source="F:\GUI\WPFMwiWindows_Src\WPFMwiWindows\Xml\MenuDonnees.xml" XPath="/Menu/Aide" />
    </ResourceDictionary>
    </Window.Resources>

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Office Mobile pour application WPF
    Par M0llusk59 dans le forum C#
    Réponses: 4
    Dernier message: 05/07/2013, 11h32
  2. Plugins pour application WPF
    Par Douze144 dans le forum Windows Presentation Foundation
    Réponses: 3
    Dernier message: 05/11/2011, 12h54
  3. mvvm light toolkit pour application WPF
    Par helper_moi dans le forum Windows Presentation Foundation
    Réponses: 6
    Dernier message: 21/06/2011, 14h45
  4. Conseils et problème pour la publication d'une application WPF
    Par tom741 dans le forum Windows Presentation Foundation
    Réponses: 4
    Dernier message: 30/03/2009, 21h53
  5. [Outils] Quels sont ceux dédiés à des tests automatisés pour une application WPF ?
    Par rsiwpf dans le forum Windows Presentation Foundation
    Réponses: 1
    Dernier message: 23/09/2008, 17h21

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo