tag:blogger.com,1999:blog-2115056243892631308.post5298646392384699791..comments2008-10-08T08:31:13.730-07:00Comments on Kevin@Work: Bag-o-Tricks March '08 EditionKevin Moorehttp://www.blogger.com/profile/18365156142606779890noreply@blogger.comBlogger13125tag:blogger.com,1999:blog-2115056243892631308.post-25741843449044778322008-10-08T08:31:00.000-07:002008-10-08T08:31:00.000-07:002008-10-08T08:31:00.000-07:00Hi!great stuff!I had a minor issue with displaying...Hi!<BR/>great stuff!<BR/>I had a minor issue with displaying of datestrings.<BR/><BR/>I just replaced this line in DatePicker.cs in method DoFormat(DateTime):<BR/><B>CultureInfo cultureInfo = Language != null ? Language.GetSpecificCulture() : null;</B><BR/>with this one<BR/><B><BR/>CultureInfo cultureInfo = System.Threading.Thread.<BR/>CurrentThread.CurrentCulture;<BR/></B><BR/><BR/>Because we have to make sure the user sees the date in the way he wants to see (according to his culture).<BR/>Is there a specific reason you used the 'Language' property here?<BR/><BR/>Anyway, thank you again!Roelhttp://www.blogger.com/profile/00218380478763625372noreply@blogger.comtag:blogger.com,1999:blog-2115056243892631308.post-48143274049395121342008-09-30T08:15:00.000-07:002008-09-30T08:15:00.000-07:002008-09-30T08:15:00.000-07:00Great work! Congratulations.Great work! Congratulations.Eduardo - B.A., Argentinanoreply@blogger.comtag:blogger.com,1999:blog-2115056243892631308.post-64693621117502205632008-09-15T05:17:00.000-07:002008-09-15T05:17:00.000-07:002008-09-15T05:17:00.000-07:00Hi the Bag is the great but I cann't find no descr...Hi the Bag is the great but I cann't find no descriptions in form of help file alaike MSDN's. So where I can find that help with descriptions of your PF controls from Bag?Kolja2003noreply@blogger.comtag:blogger.com,1999:blog-2115056243892631308.post-16144461256975730172008-07-28T05:50:00.000-07:002008-07-28T05:50:00.000-07:002008-07-28T05:50:00.000-07:00A very nice set of controls but I can't get the da...A very nice set of controls but I can't get the date picker to appear on my form. After much fiddling I got the compiler to accept my uri to a library that only contains the month and date controls and classes (and which builds). I have added the controls to an existing xaml page exactly as per the demo app page and although it builds and runs. I can't see anything. I also haven't found any good beginners wpf control tutorials to try and work out what might or might not be wrong. Is it because the stack panel doesn't know what it is?<BR/><StackPanel Orientation="Horizontal"><BR/><Label>Start Date:</Label><BR/><ResourcingControls:DatePicker HorizontalAlignment="Center" VerticalAlignment="Top" <BR/>Width="200" Name="m_DatePicker" /><BR/><Button ToolTip="Click here to move the schedule grid" IsEnabled="True">Move</Button><BR/><Rectangle Fill="Transparent" Stroke="Transparent" Width="100" /><BR/><ComboBox SelectionChanged="RegionChanged" SelectedIndex="0" Width="200"><BR/> //ComboBoxItems <BR/></ComboBox><BR/></StackPanel>Lukoshttp://www.blogger.com/profile/02601476481993496335noreply@blogger.comtag:blogger.com,1999:blog-2115056243892631308.post-52360666839499538242008-05-29T03:06:00.000-07:002008-05-29T03:06:00.000-07:002008-05-29T03:06:00.000-07:00Brandon,I've spent over an hour on this. It's beca...Brandon,<BR/>I've spent over an hour on this. It's because the datetime you're binding to has a Time element (perhaps DateTime.Now ?) Use DateTime.Now.Date instead. It's a bit of a bug in the calendar control in Unselect() (MonthCalendar.cs). <BR/><BR/>Additionally, I added the following to the constructor to work around the text formatting.<BR/><BR/> Language = System.Windows.Markup.XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.Name);<BR/><BR/>Good control, thanks.Paul Spiterinoreply@blogger.comtag:blogger.com,1999:blog-2115056243892631308.post-20669439139838568192008-04-23T13:03:00.000-07:002008-04-23T13:03:00.000-07:002008-04-23T13:03:00.000-07:00I wish I could provide a solution, but it seemed t...I wish I could provide a solution, but it seemed to start to work without any problems. Not sure what changed for it to start to work.<BR/><BR/>BrandonBrandon Petersenhttp://www.blogger.com/profile/04577633826956834003noreply@blogger.comtag:blogger.com,1999:blog-2115056243892631308.post-25112706403422487922008-04-23T07:50:00.000-07:002008-04-23T07:50:00.000-07:002008-04-23T07:50:00.000-07:00Hello,I have the same problem as Brandom.Also, cou...Hello,<BR/><BR/>I have the same problem as Brandom.<BR/>Also, could you explain in your blog how to change the string date format for other locales than English?<BR/><BR/>ThanksDanielhttp://www.blogger.com/profile/01064869278923955185noreply@blogger.comtag:blogger.com,1999:blog-2115056243892631308.post-74727017963843996092008-04-15T09:02:00.000-07:002008-04-15T09:02:00.000-07:002008-04-15T09:02:00.000-07:00I'm using the DatePicker, I really appreciate the ...I'm using the DatePicker, I really appreciate the work. When I set the value of DatePicker in my code, I'm no longer able to change the date through the datePicker dialog. Even when I set the readOnly property to false and the canEdit property to true, it still won't let me update the date. Is there anything that I'm missing.<BR/><BR/>endDate.Value = DateTime.Now;<BR/>endDate.CanEdit = true;<BR/>endDate.IsReadOnly = false;<BR/><BR/>Thanks!<BR/><BR/>Brandon PetersenBrandon Petersenhttp://www.blogger.com/profile/04577633826956834003noreply@blogger.comtag:blogger.com,1999:blog-2115056243892631308.post-2770611833475977692008-03-20T06:54:00.000-07:002008-03-20T06:54:00.000-07:002008-03-20T06:54:00.000-07:00Hi there,Great stuff!!!RegardsC# DiscipleHi there,<BR/><BR/>Great stuff!!!<BR/><BR/>Regards<BR/>C# DiscipleMarlon Grechhttp://marlongrech.wordpress.comnoreply@blogger.comtag:blogger.com,1999:blog-2115056243892631308.post-46797082333977930132008-03-14T13:36:00.000-07:002008-03-14T13:36:00.000-07:002008-03-14T13:36:00.000-07:00Hi Kevin,Can you explain why you chose to define W...Hi Kevin,<BR/><BR/>Can you explain why you chose to define <I>WrapperElement<T></I> instead of simply inheriting from <I>Decorator</I>? They seem to be doing the same thing.<BR/><BR/>Cheers,<BR/>Yuvalyuvalnoreply@blogger.comtag:blogger.com,1999:blog-2115056243892631308.post-81260474365801201942008-03-12T12:48:00.000-07:002008-03-12T12:48:00.000-07:002008-03-12T12:48:00.000-07:00Hi Kevin,Thanks for your helpful library!I just us...Hi Kevin,<BR/>Thanks for your helpful library!<BR/>I just used the Reveal component and found a small issue regarding the sizing of the content.<BR/>The code omits the horizontal and vertical alignment rules when they're set to stretch mode.<BR/>I did this minor change inside Reveal.cs and it works fine:<BR/><BR/> protected override Size ArrangeOverride(Size finalSize)<BR/> {<BR/> UIElement child = Child;<BR/> if (child != null)<BR/> {<BR/> double percent = AnimationProgress;<BR/> HorizontalRevealMode horizontalReveal = HorizontalReveal;<BR/> VerticalRevealMode verticalReveal = VerticalReveal;<BR/><BR/> double childWidth = child.DesiredSize.Width;<BR/> double childHeight = child.DesiredSize.Height;<BR/><B> if(HorizontalAlignment == HorizontalAlignment.Stretch && childWidth < finalSize.Width)<BR/> childWidth = finalSize.Width;<BR/> if(VerticalAlignment == VerticalAlignment.Stretch && childHeight < finalSize.Height)<BR/> childHeight = finalSize.Height;</B><BR/> double x = CalculateLeft(childWidth, percent, horizontalReveal);<BR/> double y = CalculateTop(childHeight, percent, verticalReveal);<BR/><BR/> child.Arrange(new Rect(x, y, childWidth, childHeight));<BR/><BR/> childWidth = child.RenderSize.Width;<BR/> childHeight = child.RenderSize.Height;<BR/> double width = CalculateWidth(childWidth, percent, horizontalReveal);<BR/> double height = CalculateHeight(childHeight, percent, verticalReveal);<BR/> return new Size(width, height);<BR/> }<BR/><BR/> return new Size();<BR/> }Morganhttp://www.blogger.com/profile/12592955650948279167noreply@blogger.comtag:blogger.com,1999:blog-2115056243892631308.post-1945778207021608872008-03-10T21:26:00.000-07:002008-03-10T21:26:00.000-07:002008-03-10T21:26:00.000-07:00hi,kevin ,Bag-o-Triks a good sample and applicatio...hi,kevin ,Bag-o-Triks a good sample and application free source for learning wpf,i hvae a question than you i don't have e-mail than you i create blog in blogspot and i want writing colorizer code in a comment , i write code in my blog like http://work.j832.com/2008/02/xaml-serialization-with-wcf.html thank you alotAmirnoreply@blogger.comtag:blogger.com,1999:blog-2115056243892631308.post-28891744588184770332008-03-09T07:48:00.000-07:002008-03-09T07:48:00.000-07:002008-03-09T07:48:00.000-07:00This is great.How much work would it be to tweak t...This is great.<BR/><BR/>How much work would it be to tweak this to make it work in Silverlight?Doughttp://dougfinke.com/blognoreply@blogger.com