SilverlightShow: Developing Silverlight AnalogClock – part 2 – Enhancing the view Comments http://www.silverlightshow.net/ Silverlight articles, Silverlight tutorials, Silverlight videos, Silverlight samples SilverlightShow.net http://www.rssboard.org/rss-specification Argotic Syndication Framework 2008.0.2.0, http://www.codeplex.com/Argotic en-US estoychev@completit.com (Emil Stoychev) RE: Developing Silverlight AnalogClock – part 2 – Enhancing the view <p>Hi Nrj,</p> <p>Thanks about your idea for using ViewBox. Thus the control could be scaled in custom size. :)</p> http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx#comment5816 ppopadiyn http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx Thu, 31 Mar 2011 15:44:23 GMT RE: Developing Silverlight AnalogClock – part 2 – Enhancing the view <p>Actually if you must know, ....referring to the file AnalogClockV2.xaml, I tried Putting the Grid which is drawing the Analog Clock V2 INSIDE A ViewBox which is a Silverlight control, gave me ability to resize the control as a single UNIT.</p> http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx#comment5815 Nitin Rajora http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx Thu, 31 Mar 2011 10:14:40 GMT RE: Developing Silverlight AnalogClock – part 2 – Enhancing the view <p>Hello Nrj, </p> <p>Unfortunately, the curent implementation (design) of the control does not allow you resizing:-(. </p> http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx#comment5806 ppopadiyn http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx Wed, 30 Mar 2011 11:38:28 GMT RE: Developing Silverlight AnalogClock – part 2 – Enhancing the view <p>Hey Pencho,</p> <p>A great piece of work.. it works all fine and shiny and integrates in minutes.. <br /> I needed to know whether it's possible to be able to resize it. And how to do it with respect to this control !!??</p> <p>Thanks for spreading the awesomeness of Silverlight!</p> http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx#comment5805 Nrj http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx Wed, 30 Mar 2011 10:39:01 GMT RE: Developing Silverlight AnalogClock – part 2 – Enhancing the view <p>Hello Reddy,</p> <p>Thank you for intereset in the Silverlight AnalogClock. Well, looking at the code now, I should admit that the control is not very well designed in terms of customization and extensibility. To set your own time, you should change the following code:</p> <ul> <li>In ClockBase.cs, take a look at the timer_Tick event handler.The call to the UpdateClockData method updates the digital clock. <em>For example: this.UpdateClockData(DateTime.Now.AddHours(1));</em></li> <li>The second place in the AnalogClock_v2.xaml.cs class. There you should modify the <em>XXX_Loaded</em> event handlers according to your logic. <em>For example: this.HoursHandStoryboard.Seek( DateTime.Now.TimeOfDay.Add( TimeSpan.FromHours( 1 ) ) );</em></li> </ul> <p>Hope that will help you a little bit.</p> http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx#comment5549 ppopadiyn http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx Mon, 21 Feb 2011 18:49:19 GMT RE: Developing Silverlight AnalogClock – part 2 – Enhancing the view Great work. Is it possible to set my own time in this control? i tried to do that, but didn't work. any help on this is appreciated. http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx#comment5543 Reddy http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx Sun, 20 Feb 2011 01:07:12 GMT RE: Developing Silverlight AnalogClock – part 2 – Enhancing the view <p>Nice Stuff</p> http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx#comment5067 Anjali http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx Tue, 14 Dec 2010 12:40:28 GMT RE: Developing Silverlight AnalogClock – part 2 – Enhancing the view <p>Hi Brandon,</p> <p>The problem is in the ClockBase class, line 84 ( in the timer_Tick event handler). I invoke the UpdateClockData method with "DateTime.Now" as an argument. So probably, you should change the logic in that line, to consider your initial time. The second place where you should change the logic is in the AnalogClock_v2.xaml.cs (in the code-behind). You should adjust the StoryboardHands according to the new date time. Too many changes for a single request, which means bad design :)</p> http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx#comment4194 ppopadiyn http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx Mon, 09 Aug 2010 08:32:14 GMT RE: Developing Silverlight AnalogClock – part 2 – Enhancing the view <p>Thanks for this demo. I have a question though.  When initialize the clock with a different time from DateTime.Now</p> <p>            TimeSpan ts = new TimeSpan(0, 10, 0);<br /> <br /> <br />             IClockModel clockModel = Clock.Create();<br />             clockModel.ClockData = new ClockData().Update(ts);<br />             ClockPresenter presenter = new ClockPresenter(this.AnalogClockControl_v2, clockModel);<br /> <br /> <br />             presenter.Response += new Callback(this.AnalogClockControl_v2.Update);<br />             clockModel.Start();</p> <div><br /> </div> <p><br /> </p> <p>The clock still displays the value for DateTime.Now. Why is that?</p> http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx#comment4170 Brandon http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx Sun, 08 Aug 2010 01:10:41 GMT RE: Developing Silverlight AnalogClock – part 2 – Enhancing the view very nice.I liked it very much. http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx#comment3996 Harinath http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx Fri, 16 Jul 2010 16:26:41 GMT RE: Developing Silverlight AnalogClock – part 2 – Enhancing the view Thanks for your publishing this article. Liked it very much. http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx#comment3371 Samuel http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx Sat, 10 Apr 2010 22:12:16 GMT RE: Developing Silverlight AnalogClock – part 2 – Enhancing the view Really cool. Gives me hope with Silverlight !! http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx#comment2565 Mauri http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx Wed, 21 Oct 2009 19:15:38 GMT RE: Developing Silverlight AnalogClock – part 2 – Enhancing the view Thanks! <p>I love it </p> http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx#comment2419 hoanghuu http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx Tue, 29 Sep 2009 20:03:16 GMT RE: Developing Silverlight AnalogClock – part 2 – Enhancing the view Would you happen to have another version that has the ability to size the clock to any dimension? http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx#comment1682 Scott http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx Wed, 24 Jun 2009 07:33:59 GMT RE: Developing Silverlight AnalogClock – part 2 – Enhancing the view Hi Adrian<div><br /></div><div>Thanks for the nice words, I am not good in making a good design, but much to my surprise  the second version of the clock is really good. So about your question, you don't need to make any additional efforts to integrate the clock in your web page. You should download the sources, take the .xap file and integrate it in your HTML or ASP page. That is the only thing you need to do.</div> http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx#comment1400 ppopadiyn http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx Wed, 01 Apr 2009 14:48:09 GMT RE: Developing Silverlight AnalogClock – part 2 – Enhancing the view Thanks for the demo, really good looking clock. <p>What would be the easiest way to add this clock to my page using your existing code?</p> <p> Regards</p> http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx#comment1399 Adrian http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx Wed, 01 Apr 2009 11:34:30 GMT RE: Developing Silverlight AnalogClock – part 2 – Enhancing the view <p>Great! Looks really nice, thanks for sharing! Keep up good work</p> http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx#comment1054 Alex http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx Sat, 14 Feb 2009 02:38:00 GMT RE: Developing Silverlight AnalogClock – part 2 – Enhancing the view <p>Thanks for sharing</p> http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx#comment1013 Abderrahmane http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx Wed, 04 Feb 2009 03:07:14 GMT RE: Developing Silverlight AnalogClock – part 2 – Enhancing the view <p>Outstanding!</p> http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx#comment862 Philip http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx Mon, 22 Dec 2008 09:28:44 GMT RE: Developing Silverlight AnalogClock – part 2 – Enhancing the view <p>Very nice demo</p> http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx#comment756 Rajesh Nirala http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx Tue, 25 Nov 2008 08:14:45 GMT RE: Developing Silverlight AnalogClock – part 2 – Enhancing the view <p>Hi Geetha</p> <p>You can read the '<a href="http://www.silverlightshow.net/GetStarted.aspx">Get Started</a>' section on the site ;). If you have any further questions, do not hesitate to ask us.</p> http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx#comment755 ppopadiyn http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx Tue, 25 Nov 2008 07:09:12 GMT RE: Developing Silverlight AnalogClock – part 2 – Enhancing the view <p>Nice Demoooo</p> http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx#comment752 ghjghjghj http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx Tue, 25 Nov 2008 04:14:33 GMT RE: Developing Silverlight AnalogClock – part 2 – Enhancing the view <p>hey guys,</p> <p>i am new to this....but i am very interested to try this ...how can i do that can anybody help...me</p> <p>how to install this silverlight and wat are all the requirements....</p> <p>waiting for ur replyyyy</p> <p>gitajetty@gmail.com</p> http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx#comment751 Geetha http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx Tue, 25 Nov 2008 04:13:08 GMT RE: Developing Silverlight AnalogClock – part 2 – Enhancing the view <p>Hi Tim</p> <p>Thanks for the idea, in fact it is much better than the current realization. The clock hands are drawn exactly in the way you have  described, the same solution can also be done and for drawing the clock markers and it will reduce the markup used now. Thanks again for sharing your idea.</p> http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx#comment711 ppopadiyn http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx Tue, 18 Nov 2008 14:03:34 GMT RE: Developing Silverlight AnalogClock – part 2 – Enhancing the view <p>i have learned your article, and very appreciated.</p> <p>when i develop this lesson, a idea come to me and i think all the Marker and the hands can be realized by RotateTranform which are gived the angle and the CenterX and CenterY. Do you agree with me?</p> <p>Thanks again for your article.</p> http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx#comment703 Tim http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx Tue, 18 Nov 2008 09:07:29 GMT RE: Developing Silverlight AnalogClock – part 2 – Enhancing the view <p>Hello guys,</p> <p>First, thank you for the nice words. </p> <p>Ilia, obviously you have a trained  eye. Yes, sometimes there is a problem. But I don't know the reasons. The storyboards responsible for hands moving are entirely declared in XAML. The only think I do in procedural code is to start them. I mean, I don't have any business logic connected to the storyboard. This led me to think that the problem is maybe in the plugin, but I am not sure, I must investigate it. In order to work - around the problem the clock is synchronized in each minute. That's why sometimes you can see a little flicking by the hands. But this happen only when the storyboard is not in tact.</p> http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx#comment686 ppopadiyn http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx Fri, 14 Nov 2008 08:16:43 GMT RE: Developing Silverlight AnalogClock – part 2 – Enhancing the view <p>Hi Pencho,</p> <p>Great article, congratulations!</p> <p>There is one thing I would like to share with you though. I noticed that sometimes there is small difference (2-5 sec) between the time shown by the clock hands and the one shown by the digital clock. Do you know why this happens? Thanks.</p> <p> </p> http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx#comment685 iiordanov http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx Fri, 14 Nov 2008 08:03:18 GMT RE: Developing Silverlight AnalogClock – part 2 – Enhancing the view <p>Awesome work!</p> <p>Thank you for sharing this.</p> <p>David Roh</p> http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx#comment683 davidjjon http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx Fri, 14 Nov 2008 03:30:09 GMT RE: Developing Silverlight AnalogClock – part 2 – Enhancing the view <p>Great Demo!</p> <p> </p> <p>http://www.iparag.com</p> http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx#comment679 Parag Mehta http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx Thu, 13 Nov 2008 22:25:44 GMT