今朝 通勤途中、紙のMSDNマガジン(英語)を読んでいたのだけど(あまり読めないので(英語的な意味で)内容がどんなのあるか確認する程度)、WPF MVVMパターン良さそうですね → WPF のための MODEL-VIEW-VIEWMODEL (MVVM) デザイン パターン すでにkazukiさんがエントリされてました(流石)→ [WPF][C#]Model View ViewModelパターンでハローワールド
パターンとは少し関係ないかもだけど、記事中のプロパティを検証するコードが良い感じですね。INotifyPropertyChangedインターフェースを使うと、プロパティ名を文字列で扱うのでスペルミスしてしまうことがあるんですよね。それの対策コード。
Public Event PropertyChanged(ByVal sender As Object, ByVal e As PropertyChangedEventArgs) Implements INotifyPropertyChanged.PropertyChanged
Public Sub OnPropertyChanged(ByVal propertyName As String)
Me.VerifyPropertyName(propertyName)
RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propertyName))
End Sub
<Conditional("DEBUG"), DebuggerStepThrough()> _
Public Sub VerifyPropertyName(ByVal propertyName As String)
If TypeDescriptor.GetProperties(Me)(propertyName) Is Nothing Then
Dim msg As String = "Invalid property name: " & propertyName
If Me.ThrowOnInvalidPropertyName Then
Throw New Exception(msg)
Else
Debug.Fail(msg)
End If
End If
End Sub
Private privateThrowOnInvalidPropertyName As Boolean = True
Protected Overridable Property ThrowOnInvalidPropertyName() As Boolean
Get
Return privateThrowOnInvalidPropertyName
End Get
Set(ByVal value As Boolean)
privateThrowOnInvalidPropertyName = value
End Set
End Property
詳しくは記事&コードで(まだ読んでない)。VB.NETでもコードサンプルが提供されていることに少し感動したw
Code for "WPF Apps With the Model-View-ViewModel Design Pattern" - Release: Initial Release
フィードバック
# re: プロパティを検証するコード @MVVM
2009/02/26 7:59 by
自分、Conditional("DEBUG") 属性にシビレました。
ここで使うのかって感じ。
# re: プロパティを検証するコード @MVVM
2009/02/26 20:27 by
コメありがとうございます。
しびれましたか。
私だと#IF DEBUGって書いちゃいそう。今度からはこれ使おう。
# ODtIkAqdJfbQQMficsp
2012/01/04 7:18 by
1aaxNo Informative, but not convincing. Something is missing but what I can not understand. But I will say frankly: bright and benevolent thoughts!...
# DrbetXsTCHGbGaXF
2014/08/06 22:18 by
jPA7It I appreciate you sharing this post.Really looking forward to read more. Really Great.
# AoGmkrmEcRXnzCJj
2014/09/03 10:49 by
Hello! I've been following your website for a while now and finally got the courage to go ahead and give you a shout out from Humble Texas! Just wanted to mention keep up the excellent work!
# yMgwRROThcydQna
2014/09/06 21:55 by
An fascinating dialogue is value comment. I feel that you must write extra on this topic, it won't be a taboo subject but generally people are not enough to speak on such topics. To the next. Cheers
# mtqPWuROAGcAZeh
2014/09/09 11:48 by
I enjoy, result in I found exactly what I used to be taking a look for. You've ended my four day long hunt! God Bless you man. Have a great day. Bye
# nouJkTqrVqHdfHwkpG
2014/09/10 21:17 by
Very well written story. It will be useful to everyone who employess it, including me. Keep doing what you are doing - for sure i will check out more posts.
# vVRXqwpXScHeAfRoZWs
2014/09/11 19:50 by
Usually I do not learn article on blogs, however I would like to say that this write-up very pressured me to check out and do so! Your writing taste has been amazed me. Thanks, very great article.
# GwNkAkTflzESeMLxIe
2014/09/11 21:14 by
This site is mostly a stroll-by way of for all the information you wished about this and didn't know who to ask. Glimpse here, and also you'll definitely uncover it.
# sPCBwlFaWxUP
2014/09/15 11:43 by
Thanks for the auspicious writeup. It in fact used to be a enjoyment account it. Look advanced to far added agreeable from you! By the way, how could we keep up a correspondence?
# vgDmXnOdMZIO
2014/09/16 18:55 by
you have an incredible blog here! would you like to make some invite posts on my blog?
# XGRVWLluzUIqkiGM
2018/08/16 3:01 by
ZgnooL I truly appreciate this article.Thanks Again. Keep writing.
# hQoirVtVmKEV
2018/08/18 2:47 by
Some really select content on this site, saved to fav.
# nVPAOjfKmlcjDctLca
2018/08/19 3:49 by
Thanks for the auspicious writeup. It in reality was once a
# AnHZAeFSeVPshYGQeD
2018/08/19 4:54 by
I truly appreciate this post. I ave been looking everywhere for this! Thank goodness I found it on Bing. You ave made my day! Thx again!
# mlwgeSoDdpQimLFQfWQ
2018/08/20 15:51 by
The sketch is tasteful, your authored material stylish.
# HVwGPcyxsyJBWDb
2018/08/21 23:12 by
This unique blog is without a doubt entertaining and factual. I have picked many handy tips out of this source. I ad love to go back over and over again. Thanks a lot!
# vhICBqXkOpd
2018/08/22 4:35 by
Very good article.Really looking forward to read more. Fantastic.
# FjpTVMdXsTKE
2018/08/22 23:07 by
Wanted to drop a remark and let you know your Feed isnt working today. I tried including it to my Google reader account but got nothing.
# GgwSajLGAHQCXCCx
2018/08/23 14:03 by
space to unravel my problem. May be that as you! Looking forward to look you.
# nvlwHhSJZsgT
2018/08/23 16:37 by
Its hard to find good help I am forever proclaiming that its hard to get good help, but here is
# bJQmTERkHabrfoogb
2018/08/23 19:06 by
this I have discovered It absolutely useful and it has aided me out loads.
# TbAkaNIAYDkDFThA
2018/08/23 21:35 by
Some genuinely quality posts on this web site , saved to my bookmarks.
# arGFGkemwOCCVvHECB
2018/08/24 9:56 by
Thanks a lot for the article post.Much thanks again. Awesome.
# cIapVKGtZGuVaEySpd
2018/08/24 16:28 by
Wonderful post! We are linking to this particularly great post on our website. Keep up the great writing.
# CXEXosEcEFvlqGlo
2018/08/27 20:15 by
There is certainly a great deal to learn about this issue. I really like all of the points you ave made.
# DrxnpuatlYgH
2018/08/27 23:42 by
very good submit, i actually love this web site, carry on it
# drYmCKsTijdPsFkzdj
2018/08/28 0:27 by
Spot on with this write-up, I actually feel this website needs a lot more attention. I all probably be back again to see more, thanks for the info!
# XGxaZznUkhCvCRdxtX
2018/08/28 1:08 by
in the near future. Take a look at my website as well and let me
# KppPqDWKbYM
2018/08/28 1:44 by
Really appreciate you sharing this blog.Thanks Again. Really Great.
# tBdFyRwLgRFThSG
2018/08/28 2:46 by
There as definately a great deal to learn about this issue. I really like all the points you made.
# oHtQDYBCCkXsNVzpJ
2018/08/28 5:50 by
Im obliged for the blog article.Really looking forward to read more. Really Great.
# zmcHnezgBpxEP
2018/08/28 10:57 by
This website truly has all the information I wanted about this subject and didn at know who to ask.
# oRjRNPwaRlHQipM
2018/08/28 22:16 by
It as actually a great and useful piece of info. I am happy that you simply shared this useful info with us. Please stay us up to date like this. Thanks for sharing.
# XHZHcobzyFZAMH
2018/08/29 1:34 by
This is a good tip especially to those new to the blogosphere. Brief but very precise information Appreciate your sharing this one. A must read post!
# tCECgBfgevqd
2018/08/29 3:59 by
I was suggested this blog by my cousin. I am not sure whether this post is written by him as nobody else know such detailed about my problem. You are amazing! Thanks!
# LTcsZaUpYzVZCgB
2018/08/29 19:54 by
Thanks for some other great post. Where else may anybody get that kind of information in such an ideal method of writing? I ave a presentation next week, and I am at the look for such information.
# wubbClnEWdpczNLCKtG
2018/08/29 21:39 by
I simply couldn at depart your web site prior to suggesting that I really enjoyed the
# UzAYSIFSwFYSqj
2018/08/30 3:09 by
Really enjoyed this post.Much thanks again. Much obliged.
# bUCmtelMkiPFy
2018/08/30 19:50 by
This is my first time pay a visit at here and i am really impressed to read all at alone place.
# HyJalbofTrpHSwdCiy
2018/08/30 22:10 by
Incredible! This blog looks just like my old one! It as on a totally different topic but it has pretty much the same page layout and design. Excellent choice of colors!
# TZRNXfGlEXynoszH
2018/08/31 18:47 by
You have brought up a very superb details , thanks for the post.
# wyxPhklNjcDUFZDIM
2018/09/01 10:57 by
Womens Ray Ban Sunglasses Womens Ray Ban Sunglasses
# wsqaAJqPaSLSgkRdHz
2018/09/01 19:59 by
Thanks for the article post.Really looking forward to read more. Great.
# nzTMHnsKVaGt
2018/09/01 22:32 by
You have brought up a very wonderful points , thankyou for the post.
# hESwyGGcnjW
2018/09/02 21:06 by
Many thanks! Exactly where are your contact details though?
# MfQVBoHPJVYlPc
2018/09/03 19:42 by
time here at web, however I know I am getting knowledge all the time by
# cKYqmjYjHsOPPPqZuvx
2018/09/05 0:34 by
much healthier than its been in some time. Manning,
# cPqReQmwDRWDss
2018/09/05 6:29 by
Wow, superb weblog layout! How lengthy have you been running a
# CyhvkxiFvpYZppdrWMM
2018/09/06 17:02 by
There is definately a lot to learn about this issue. I like all of the points you have made.
# lUFKqujWUYa
2018/09/10 18:10 by
What as up, I just wanted to say, I disagree. Your point doesn at make any sense.
# afjREIimOOeA
2018/09/12 0:54 by
really excellent post, i undoubtedly actually like this incredible web-site, go on it
# MARyVvFMYf
2018/09/12 16:11 by
You ave made some decent points there. I looked on the web for additional information about the issue
# RiznHLMCGxbZnDna
2018/09/12 19:24 by
Major thankies for the post.Much thanks again. Want more.
# osOjChPIwWtjrIxjx
2018/09/13 0:12 by
Really informative blog article.Really looking forward to read more. Really Great.
# LhoIdPuVgWpuvF
2018/09/13 1:46 by
wonderful points altogether, you simply gained a brand new reader. What might you recommend in regards to your publish that you simply made a few days in the past? Any positive?
# hkPbSLIExmUkRoY
2018/09/13 6:27 by
moment this time I am browsing this website and reading very informative
# WkNScyOArijT
2018/09/13 11:10 by
Thanks , I ave recently been searching for information approximately this subject for a long
# sSEoXVQtQt
2018/09/14 23:48 by
This is my first time go to see at here and i am really happy to read everthing at alone place.|
# qlTIvxnjrjyBxXpamw
2018/09/15 4:01 by
wow, awesome article post.Thanks Again. Want more.
# FfIAhMBEBncPhzoPW
2018/09/17 20:30 by
Im obliged for the blog.Really looking forward to read more. Really Great.
# lAGZuxHFENhHFY
2018/09/18 4:18 by
This actually answered my problem, thanks!
# LNgfZeDAgKbZkM
2018/09/20 1:27 by
JAPAN JERSEY ??????30????????????????5??????????????? | ????????
# mUopRBARfJqzfUobtZo
2018/09/20 9:59 by
Wow, great article post.Thanks Again. Fantastic.
# IjucKGCWNNZCa
2018/09/21 19:20 by
When Someone googles something that relates to one of my wordpress blogs how can I get it to appear on the first page of their serach results?? Thanks!.
# lzvwIlXYrURT
2018/09/24 21:57 by
I think this is one of the most important information for me.
# KqmpCaiedGucnpPB
2018/09/26 0:57 by
tiffany rings Secure Document Storage Advantages | West Coast Archives
# VQlvHJyYGKTZMGO
2018/09/26 14:06 by
This website certainly has all of the info I wanted about thus subject aand didn at know who
# vyeBcjkYUxvpNqBQ
2018/09/26 18:44 by
Looking forward to reading more. Great blog.Really looking forward to read more. Want more.
# zaFSbqfkJNq
2018/09/28 1:53 by
What as Happening i am new to this, I stumbled upon this I ave found It absolutely helpful and it has helped me out loads. I hope to contribute & aid other users like its helped me. Good job.
# agsuHiHiFjnrqbGuIF
2018/10/01 23:58 by
You ave made some good points there. I looked on the internet for more information about the issue and found most individuals will go along with your views on this site.
# wByCwPmRtMNnAS
2018/10/02 19:00 by
Whoa! This blog looks just like my old one! It as on a entirely different subject but it has pretty much the same page layout and design. Great choice of colors!
# tyMlwCKpot
2018/10/02 22:08 by
Loving the info on this website , you have done outstanding job on the blog posts.
# pLRKejKwBnPFZDHWdpo
2018/10/06 4:52 by
I would really like you to turn out to be a guest poster on my blog.-; a-
# YPiRweDQskG
2018/10/07 20:23 by
Im thankful for the article.Thanks Again. Much obliged.
# XaLKBbDFss
2018/10/07 22:01 by
It as hard to search out knowledgeable folks on this matter, but you sound like you recognize what you are talking about! Thanks
# TwZaJrGTIjwRv
2018/10/08 3:12 by
Tiffany Jewelry Secure Document Storage Advantages | West Coast Archives
# oKTJMKHsFnop
2018/10/08 12:21 by
motorcycle accident claims What college-university has a good creative writing program or focus on English?
# youetQLemaLgZuY
2018/10/08 15:09 by
That is a very good tip especially to those fresh to the blogosphere. Brief but very precise information Thanks for sharing this one. A must read post!
# dTUZwQQDDhYqth
2018/10/09 8:15 by
you continue this in future. A lot of people will be benefited from your writing.
# EKMPssosuudO
2018/10/09 10:08 by
loans will be the method where you will get your cash.
# JiDSiweiHXjAh
2018/10/09 14:49 by
Thanks again for the blog.Thanks Again. Much obliged.
# OdIniItXXcMMT
2018/10/09 17:27 by
I think this is a real great blog article. Keep writing.
# TKmVOrLfOW
2018/10/09 19:36 by
Please forgive my English.Wow, fantastic blog layout! How lengthy have you been running a blog for? you made blogging glance easy. The entire look of your website is fantastic, let alone the content!
# wDnreqOrOdFKqLNUdq
2018/10/10 1:08 by
you have a great weblog right here! would you like to make some invite posts on my weblog?
# BkrnRGfIOPaIO
2018/10/10 3:21 by
What as up, just wanted to mention, I enjoyed this post. It was funny. Keep on posting!
# WotwnUzoagmsCquDPLq
2018/10/10 9:09 by
wow, awesome post.Really looking forward to read more. Will read on...
# zxwMJtEVrCTPLmWp
2018/10/10 15:06 by
This is a great tip especially to those fresh to the blogosphere. Brief but very precise information Appreciate your sharing this one. A must read article!
# EeZRjpTTNAQwTUSIdM
2018/10/10 19:01 by
pretty practical stuff, overall I consider this is worth a bookmark, thanks
# jSsorjYiTBj
2018/10/11 0:57 by
Perfectly composed articles, Really enjoyed studying.
# VlmzdOaLJeoxMm
2018/10/11 17:22 by
Very neat post.Really looking forward to read more. Much obliged.
# sqEgijTwzCQwTPMiJ
2018/10/11 18:34 by
Im obliged for the article.Really looking forward to read more. Much obliged.
# HfDRCpbSJqgh
2018/10/13 7:29 by
Wow, awesome blog layout! How lengthy have you been blogging for? you make blogging look easy. The entire look of your website is magnificent, let alone the content material!
# qXutFXefRngzjaDyEoe
2018/10/13 13:15 by
you heard about this new site ? Dallas SEO
# CsoURTzeqkKCfYuzAJ
2018/10/13 16:19 by
will be back to read a lot more, Please do keep up the awesome
# dJYhbAizkUpw
2018/10/13 22:07 by
Pretty! This has been an incredibly wonderful article. Many thanks for providing this info.
# qJzxdMIrfRglOm
2018/10/14 13:57 by
That is a good tip particularly to those fresh to the blogosphere. Brief but very precise info Appreciate your sharing this one. A must read post!
# hellow dude
2019/01/06 18:19 by
# Air Jordan 12 Gym Red
2019/04/13 3:08 by
txyexi,If you want a hassle free movies downloading then you must need an app like showbox which may provide best ever user friendly interface.
# Yeezy
2019/04/21 9:23 by
the Provincial Civil Affairs Department, the Provincial Poverty Alleviation Office, the Provincial Development and Reform Commission, the Provincial Finance Department, and the Provincial Disabled Persons' Federation have gone to Baicheng. , went to Weinan City for a field investigation.
# Pandora Official Site
2019/04/23 13:53 by
Dalio said that capitalism has developed into a system that promotes the widening gap between the rich and the poor, thus leaving the United States at risk of survival. Dalio published a two-part series on the professional social networking site, pointing out that capitalism is now in urgent need of reform and proposed a reform approach.
# Nike React Element 87
2019/04/26 1:29 by
The Zoom Alpha from 1995 unfortunately falls in that category, but those in the know have been keeping their eyes peeled on what Swoosh plans to do with the first-ever Zoom cushioning running shoe in history.
# re: ??????????????@MVVM
2021/08/07 10:45 by
is chloroquine available over the counter
https://chloroquineorigin.com/# hydroxycloquine