2017-10-01 4 views
0

のWindows 10にVisual Studio 2017とでWPFアプリケーションでリボンを作成します。 。 XAMLコード:私は次のように新しいアプリケーションにリボンを追加し、私は、Windows 10上でWindowsクラシックデスクトップ用に2017のVisual Studioで</p> <p>を新しいWPFアプリケーションを作成しました

<r:RibbonWindow x:Class="AKnowledgeBase.MainWindow" 
     xmlns:r1="http://schemas.microsoft.com/winfx/2006/xaml/presentation/ribbon" 
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
     xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
     xmlns:local="clr-namespace:AKnowledgeBase" 
     mc:Ignorable="d" 
     xmlns:r="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary" 
       xmlns:r2="clr-namespace:Microsoft.Windows.Controls.Ribbon.Primitives;assembly=RibbonControlsLibrary" 
       Title="AKnowledgeBase" Height="350" Width="525"> 
    <DockPanel> 
     <r:Ribbon> 
      <r2:RibbonTabsPanel></r2:RibbonTabsPanel> 
     </r:Ribbon> 

    </DockPanel> 

</r:RibbonWindow> 

そして、基本クラスを変更します。

public partial class MainWindow : RibbonWindow 
    { 
     public MainWindow() 
     { 
      InitializeComponent(); 
     } 
    } 

しかし、結果のアプリケーションウィンドウが醜い:あなたが見ることができ、上記画像を

enter image description here

にエクスプローラキャプション(Windows10では標準ビュー)と作成されたアプリケーションキャプション(Windows98スタイルのビューのように見えます)。

なぜ起こり、どのように修正できるのでしょうか?

UPD1

Iが使用System.Windows.Controls.Ribbon.dllを参照の下、メインウィンドウを提案し、左とRIGH側に青色のアーチファクトを有する: enter image description here

また場合Iこのウィンドウを最大化 - があるキャプションのバグ表示されます:

enter image description here

は、テキストpartitiallyカット。

答えて

0

おそらく、あなたのr、r1とr2の参照と一緒にテーマベースのスタイリングを追加したでしょう。私はあなたがデフォルトのスタイリングをオーバーライドせずにリボンを構築する方法を探してみることをお勧めします。

+0

いいえ、私はちょうど新しいWPFのソリューションを作成した - と、すべての変更あなたは最初の投稿で見ることができます。 – AeroSun

1

System.Windows.Controls.Ribbon.dllへの参照を追加し、このXAMLマークアップを試してみてください。

<RibbonWindow x:Class="AKnowledgeBase.MainWindow" 
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
     xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
     xmlns:r2="clr-namespace:System.Windows.Controls.Ribbon.Primitives;assembly=System.Windows.Controls.Ribbon" 
     mc:Ignorable="d" 
     Title="Window14" Height="300" Width="300"> 
    <Grid> 
     <DockPanel> 
      <Ribbon> 
       <r2:RibbonTabsPanel></r2:RibbonTabsPanel> 
      </Ribbon> 
     </DockPanel> 
    </Grid> 
</RibbonWindow> 

おそらくRibbonWindowを必要としない:

<Window x:Class="AKnowledgeBase.MainWindow" 
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
     xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
     xmlns:local="clr-namespace:WpfApplication7" 
     xmlns:r2="clr-namespace:System.Windows.Controls.Ribbon.Primitives;assembly=System.Windows.Controls.Ribbon" 
     mc:Ignorable="d" 
     Title="Window14" Height="300" Width="300"> 
    <Grid> 
     <DockPanel> 
      <Ribbon> 
       <r2:RibbonTabsPanel></r2:RibbonTabsPanel> 
      </Ribbon> 
     </DockPanel> 
    </Grid> 
</Window> 
+0

1)あなたについて最初の提案 - 最初の投稿で更新を見てください – AeroSun

+0

どのアップデート? RibbonControlsLibrary.dllは使用しないでください。 – mm8

+0

2)「あなたはおそらくRibbonWindowを必要としません」と言っていますが、通常のWindowを使用していれば必要です。最初の通常のウィンドウキャプション、いくつかのコントロールを描画できる2番目の「リボンキャプション」の2つのキャプションが表示されます。 – AeroSun

関連する問題

 関連する問題