2009-08-28 7 views
2

私は、WPF/XAMLの用語を使用しようとしていますが、私はUIコーディングに対する流暢なインターフェイスのアプリケーションに興味を持っています。流暢なWPFプロジェクトはありますか?

私はFluent Silverlight(http://code.google.com/p/fluent-silverlight/)を認識していますが、WPFと同等のものは見つけられません。

XAMLとC#/ MVVMを組み合わせて購入するのは非常に難しいことです。宣言型XAMLよりも優れたコードで表現されるUIプログラミング(データバインディングなど)があることは私には分かります。

流暢なWPFインターフェイスは、これらの目標を達成するための単なる方法のようです。

答えて

2

最近のHerdingコードのポッドキャスト:http://herdingcode.com/?p=212ゲストの一人が、WPF UIを作成するための流暢なインターフェイスを試していると話しています。彼らのうちの1人が可能なことをしている可能性があります。

ちなみに、この同じポッドキャストとその前のもの(http://herdingcode.com/?p=208)は、最初のコードと最初のビューについて懸念し、なぜxamlに集中するのが有利なのかについて話します。

主な議論は、コードのテスト容易性に加えて、デザイナーがUIを「ブレンド可能」(Microsoft Expression Blendでデザインできるようにすること)に関することです。コードベースのアプローチでは、あまり注意を払わないとこの能力が低下します。

あなたはあなたの不安で一人ではありません。うまくいけば、これらのポッドキャストはあなたが決定を下すのに役立ちます。私は流暢なスタイルでプログラムすることを好むだろうWPFの部分に実行したよう

+0

ありがとうございました。 私は両方のポッドキャストに耳を傾け、実際に流暢なシルバーライトを調べることにしました。 WPFにはクールなものがたくさん含まれています。WPFにはクールな使い方が分かります。 自分自身の出会いの危険があるので、私はWPFに相当するMFCについて考えていましたが、流暢なインターフェイスはより良いアプローチのようです。 WPFの他のバランスのとれた鑑定について他の人が知っていますか?私。完全に否定的でもなく、完全に盲目的に受け入れてもいない – kmontgom

+0

私はあまり聞いたことがありません。ほとんどの人が私が遭遇したXamlを受け入れています。それは本当に悪いです。私は今、個人的にはそれが大好きです。私は流暢なインターフェースに行かなければならないと思いますが、あなたがそれを信じることができれば面倒です。 –

+2

私はXAMLでの作業が好きですが、Fluent Interfaceやその他のコードベースのメソッドが提供できる強力な型付けや他のタイプのコンパイル・タイプ・チェックの考え方が欲しいです。データバインディングXAMLを扱うという言葉の部分は、試行錯誤コードを実行しているWeb上にいるように感じ、アプリケーションを実行してプログラミングの種類に対応しているかどうかを確認することです。私はむしろそれをテスターに​​任せておきますが、さらに悪いことに、テスターはデフォルトでバインディングエラーも見られないので、WPFエラーの処理を導入してテスターからのフィードバックを得る必要があります。バマー。 – jpierson

2

をコマンドを構築するために、私は個人的なユーティリティアセンブリにサポートする拡張メソッドを追加します。

たとえば、TaskbarItemInfoProgressValueおよびProgressStateのプロパティを示すプログラムは次のとおりです。このバージョンは標準的な流暢な方法で書かれています。ここ

using System.Windows; 
using System.Windows.Controls; 
using System.Windows.Shell; 

namespace TaskbarItemProgress 
{ 
    public partial class MainWindow : Window 
    { 
     public MainWindow() 
     { 
      InitializeComponent(); 

      TaskbarItemInfo = new TaskbarItemInfo(); 

      TaskbarItemInfo.ProgressValue = 0.5; 

      var stackPanel = new StackPanel(); 

      Content = stackPanel; 

      var normalButton = new Button() { Content = "Normal" }; 
      normalButton.Click += (s, e) => 
       TaskbarItemInfo.ProgressState = TaskbarItemProgressState.Normal; 
      stackPanel.Children.Add(normalButton); 

      var pausedButton = new Button() { Content = "Paused" }; 
      pausedButton.Click += (s, e) => 
       TaskbarItemInfo.ProgressState = TaskbarItemProgressState.Paused; 
      stackPanel.Children.Add(pausedButton); 

      var errorButton = new Button() { Content = "Error" }; 
      errorButton.Click += (s, e) => 
       TaskbarItemInfo.ProgressState = TaskbarItemProgressState.Error; 
      stackPanel.Children.Add(errorButton); 

      var indeterminateButton = new Button() { Content = "Indeterminate" }; 
      indeterminateButton.Click += (s, e) => 
       TaskbarItemInfo.ProgressState = TaskbarItemProgressState.Indeterminate; 
      stackPanel.Children.Add(indeterminateButton); 

      var noneButton = new Button() { Content = "None" }; 
      noneButton.Click += (s, e) => 
       TaskbarItemInfo.ProgressState = TaskbarItemProgressState.None; 
      stackPanel.Children.Add(noneButton); 

      var increaseButton = new Button() { Content = "Increase" }; 
      increaseButton.Click += (s, e) => TaskbarItemInfo.ProgressValue += 0.10; 
      stackPanel.Children.Add(increaseButton); 

      var decreaseButton = new Button() { Content = "Decrease" }; 
      decreaseButton.Click += (s, e) => TaskbarItemInfo.ProgressValue -= 0.10; 
      stackPanel.Children.Add(decreaseButton); 
     } 
    } 
} 

は流暢のバージョンの:流暢バージョンは、(代わりClick += ...の)

using System.Windows; 
using System.Windows.Controls; 
using System.Windows.Shell; 
using FluentWpf; 

namespace TaskbarItemProgress 
{ 
    public partial class MainWindow : Window 
    { 
     public MainWindow() 
     { 
      InitializeComponent(); 

      TaskbarItemInfo = new TaskbarItemInfo(); 

      TaskbarItemInfo.ProgressValue = 0.5; 

      Content = new StackPanel() 
       .AddChildren(
        new Button() { Content = "Normal" } 
         .AddClick((s, e) => TaskbarItemInfo.ProgressState = TaskbarItemProgressState.Normal), 
        new Button() { Content = "Paused" } 
         .AddClick((s, e) => TaskbarItemInfo.ProgressState = TaskbarItemProgressState.Paused), 
        new Button() { Content = "Error" } 
         .AddClick((s, e) => TaskbarItemInfo.ProgressState = TaskbarItemProgressState.Error), 
        new Button() { Content = "Indeterminate" } 
         .AddClick((s, e) => TaskbarItemInfo.ProgressState = TaskbarItemProgressState.Indeterminate), 
        new Button() { Content = "None" } 
         .AddClick((s, e) => TaskbarItemInfo.ProgressState = TaskbarItemProgressState.None), 
        new Button() { Content = "Increase" } .AddClick((s, e) => TaskbarItemInfo.ProgressValue += 0.10), 
        new Button() { Content = "Decrease" } .AddClick((s, e) => TaskbarItemInfo.ProgressValue -= 0.10)); 
     } 
    } 
} 

(代わりChildren.Addの)2つの拡張方法、AddChildrenを採用し、AddClickれます。私はlibrary on githubFluentWpf私の個人を保つ

enter image description here

プログラムは次のようになります。

関連する問題