{"id":146,"date":"2008-04-25T07:25:53","date_gmt":"2008-04-25T12:25:53","guid":{"rendered":"http:\/\/www.wiredprairie.us\/blog\/index.php\/archives\/146"},"modified":"2008-04-25T07:25:53","modified_gmt":"2008-04-25T12:25:53","slug":"old-school-wpf-syntax-revisited-gradientbrushes","status":"publish","type":"post","link":"https:\/\/www.wiredprairie.us\/blog\/index.php\/archives\/146","title":{"rendered":"Old school WPF syntax revisited…. GradientBrushes"},"content":{"rendered":"

Remember this syntax from the early days of Avalon<\/strike>\/WPF\/XAML?<\/p>\n

<Rectangle Width="300" Height="200"
    Fill="HorizontalGradient Blue White" >
<\/Rectangle><\/p>\n

Very simple — easy to create Gradient Brush. But, it was removed from Avalon\/<\/strike>WPF in part due to it’s challenge for tools (parsing, etc.).<\/p>\n

Mike posts<\/a> a simple MarkupExtension that although it doesn’t mimic the old syntax identically, the spirit is there.<\/p>\n

<Rectangle Width="300" Height="200"
  Fill="{local:RadialGradientBrush red, blue}" \/><\/p>\n","protected":false},"excerpt":{"rendered":"

Remember this syntax from the early days of Avalon\/WPF\/XAML? <Rectangle Width="300" Height="200"     Fill="HorizontalGradient Blue White" > <\/Rectangle> Very simple — easy to create Gradient Brush. But, it was removed from Avalon\/WPF in part due to it’s challenge for tools (parsing, etc.). Mike posts a simple MarkupExtension that although it doesn’t mimic the old syntax […]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[4],"tags":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pd5QIe-2m","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":633,"url":"https:\/\/www.wiredprairie.us\/blog\/index.php\/archives\/633","url_meta":{"origin":146,"position":0},"title":"A Silverlight 2 TilePanel","date":"December 14, 2008","format":false,"excerpt":"You may notice that the Silverlight TileBrush is missing some key properties which would enable it to actually tile a brush. The WPF TileBrush has properties such as TileMode, Viewbox, and ViewportUnits that can be used to tile an image as a fill or as a background for a UIElement.\u2026","rel":"","context":"In "Coding"","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.wiredprairie.us\/blog\/wp-content\/uploads\/2008\/12\/image1.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1449,"url":"https:\/\/www.wiredprairie.us\/blog\/index.php\/archives\/1449","url_meta":{"origin":146,"position":1},"title":".NET API for Nest Thermostat","date":"January 9, 2012","format":false,"excerpt":"I just finished a preliminary read-only (think version 0.1) wrapper around the Nest Thermostat API that is used by their mobile phone and web applications. As Nest doesn\u2019t have a formal API yet, the code could break at any time and may not be suitable for any use. However, it\u2026","rel":"","context":"In "Coding"","img":{"alt_text":"SNAGHTML88bff0b3","src":"https:\/\/i0.wp.com\/www.wiredprairie.us\/blog\/wp-content\/uploads\/2012\/01\/SNAGHTML88bff0b3_thumb.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":891,"url":"https:\/\/www.wiredprairie.us\/blog\/index.php\/archives\/891","url_meta":{"origin":146,"position":2},"title":"Resource Intensive WPF Progress Bar (animation)","date":"January 25, 2010","format":false,"excerpt":"I\u2019m using a progress bar in a small WPF application I\u2019m working on and noticed that the Private Working Set for my application seemed higher than I expected. My application, once simplified down to it\u2019s most basic element, consisted of: Window, Grid, ProgressBar On my Windows 7 x64 machine, running\u2026","rel":"","context":"In "Coding"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1701,"url":"https:\/\/www.wiredprairie.us\/blog\/index.php\/archives\/1701","url_meta":{"origin":146,"position":3},"title":"Windows 8 WinRT\/Metro Missing UpdateSourceTrigger","date":"August 5, 2012","format":false,"excerpt":"If you\u2019ve done WPF or Silverlight programming, you may have found an occasion where using the Binding property UpdateSourceTrigger set to PropertyChanged was extremely useful. (I know I have!) It may have looked something like this: The key feature was the live updating of the\u2026","rel":"","context":"In "Coding"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":477,"url":"https:\/\/www.wiredprairie.us\/blog\/index.php\/archives\/477","url_meta":{"origin":146,"position":4},"title":"Some WPF stuff…","date":"August 22, 2008","format":false,"excerpt":"From Chris, WPF Photo Print. The joke at work is often, \"Microsoft designed WPF to fit two niches, photos, and RSS readers.\" Not that there's anything wrong with a photo printer. WPF seems to be good at \"media\", less good at line of business applications. Bil discusses this very issue\u2026","rel":"","context":"In "Coding"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":458,"url":"https:\/\/www.wiredprairie.us\/blog\/index.php\/archives\/458","url_meta":{"origin":146,"position":5},"title":"JavaScript ASP.NET Data Templates (or, I was missing Data Templates in Silverlight …)","date":"August 11, 2008","format":false,"excerpt":"After you taste Data Templates in Silverlight and WPF, you won't want to go back to your old way of building user interfaces. I mean seriously, do you like the idea of building a user interface by custom drawing a list box using various owner-drawn techniques like exist in Win32?\u2026","rel":"","context":"In "Coding"","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.wiredprairie.us\/blog\/wp-content\/uploads\/2008\/08\/image-thumb1.png?resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.wiredprairie.us\/blog\/index.php\/wpjson\/wp\/v2\/posts\/146"}],"collection":[{"href":"https:\/\/www.wiredprairie.us\/blog\/index.php\/wpjson\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wiredprairie.us\/blog\/index.php\/wpjson\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wiredprairie.us\/blog\/index.php\/wpjson\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wiredprairie.us\/blog\/index.php\/wpjson\/wp\/v2\/comments?post=146"}],"version-history":[{"count":0,"href":"https:\/\/www.wiredprairie.us\/blog\/index.php\/wpjson\/wp\/v2\/posts\/146\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wiredprairie.us\/blog\/index.php\/wpjson\/wp\/v2\/media?parent=146"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wiredprairie.us\/blog\/index.php\/wpjson\/wp\/v2\/categories?post=146"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wiredprairie.us\/blog\/index.php\/wpjson\/wp\/v2\/tags?post=146"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}