|
|
Browse by Tags
All Tags » WPF » .NET 3.0 (RSS)
-
I got a couple of queries from the readers asking if I could provide a slightly non-trivial sample of using automation. So I created a split button user control which looks something like this If there are no items then you get a checkable button. The items are created in a popup and are generated on demand. This makes the automation a bit interesting. As you can see the control supports 3 patterns – · Invoke (for the button) · ExpandCollapse (for the drop down) · Toggle (for the checkable option) – This is just for demo purposes You will need to specify this in the GetPattern function which overrides the one in the base AutomationPeer. The other function that you might want to override is GetChildrenCore in case of popups. The default behavior is to go through the visual tree and get the children. However, popups are in a separate visual tree. The sample overrides the function since the items are displayed as part of a popup J Also for each of the patterns, it is necessary that we implement Read More...
|
-
Earlier on I had written an app, BlogPadm which was fulltrust and the writer used Google Data API to write the content to Blogger.com. However, when you create an xbap version of it, a problem arises in that you cannot make WebRequests outside site of origin and hence, the xbap version of the above failed to take off. The workaround is to create a webservice at the site of origin so that the calls are forwarded. However, the focus of this app was to test cookies. So I hosted a blog server and had the blogwriter at the site of origin. So the flow is something like this: http://MainSite/Login.aspx à http://blogsite/blogwriter.xbap à http://blogsite/postentry.aspx The communication between the asp pages and the xbap is through cookies. Code for this application is attached. Note that this project makes use of servers and hence, the app won’t run on execution since the server code is now on the local machine. The Blog engine used is the BlogEngine.net which is an open source blog server. The Read More...
|
-
This is a pretty nifty tool by Saveen .. The project is on codeplex: http://www.codeplex.com/VisioExportToXAML The results look amazing: (Visio rendering v/s Xaml render) Share this post Read More...
|
-
Earlier on, I had written a post on maximizing a borderless (WindowStyle=None) window but without covering the taskbar. This solution works well but was not that nice to look at implementation wise :) ... However, theres a simplere solution to achieve the same. I get quite a few queries about the previous post, so I thought it would be a good idea to post this simple solution.. < Window Width = " {DynamicResource {x:Static SystemParameters.MaximizedPrimaryScreenWidthKey}} " Height = " {DynamicResource {x:Static SystemParameters.MaximizedPrimaryScreenHeightKey}} " WindowStartupLocation = " CenterScreen " WindowStyle = " None " /> SystemParameters to the rescue... for the code behind version, win.Height = SystemParameters .MaximizedPrimaryScreenHeight; win.Width = SystemParameters .MaximizedPrimaryScreenWidth; win.Top = 0;win.Left = 0; Share this post Read More...
|
-
A month ago, I was browsing through different blogs and came across Denis Vuyka's blog post on connecting objects on the canvas... Nice post... Being an avid fan of mind maps, that was the natural extension to the library that he created. Check it out There are 3 types of objects which are basically the same... they contain rich content... Right clicking on the objects opens up an editable Richtextbox... In case you paste in Links, you can click them (Ctrl + Click) ... This opens the link in a new browser window. Maps can be saved/opened. Notice that saving a file also creates a folder with multiple streams. Ideally, everything would be zipped into a single file., I have left this upto you guys :) ... The reason for these multiple streams is the presence of images in Richtextboxes. A simple XamlWriter.Save saves only the image links and not the image. As such, the richtextboxes are saved in the xamlpackage format and picked up on opening the file.... Source code is attached so that you Read More...
|
-
Finally, the Reader SDK is out ... From the windowsclient site "These Syndicated Client Experiences applications exploit the push capabilities of RSS in a model where each application retains full control over the presentation of the content. The Sync Framework and sync service take care of syncing, caching, subscription management and the safe caching of authentication credentials. These services are designed to help publishers focus on what matters to them most: providing differentiated content experiences with very rich content, branding, skinning and custom user interface elements for an optimal end-to-end user experience" You can now create rich applications like the below very easily... :) ...you can download the msdnreader here "Included in this SDK: Visual Studio and Expression projects Sample Generic Reader (complete end to end sample, full source code) MSDN Reader (application, feed and full sample source code) Reader Quick Start wizard Photos: a simple sample demonstrating a Read More...
|
-
Recently Ahmad, our test intern, created a WPF weather user control and it came out really nice. Take a look. The code is available on code plex .. The code also includes a sample which is demo desktop weather gadget using the usercontrol. The user control provides 2 dependency properties, IsMaximized and ShowMinimizeButton.... The first property decides whether to show the control in a minimal form just as the Vista weather gadget behaves in the sidebar. The second property decides whether to show the minimize button. The setting dialog is a popup so it comes up on top of your app. The control was created with reusability and extensibility in mind. Currently it connects to the MSN xml feed. Changing the feed requires a slight tweaking in code since the xml tags differ from site to site. Please do take a look at the code .... :) Share this post Read More...
|
-
I recently came across a Hyperbolic tree implementation on codeplex using WPF and thought that a nice usage of it could be in writing a mind map creating application.... I tweaked some of the original code and got a tree with editable nodes... Its been laying around for sometime, so I thought it best to put it out there so that you folks can continue its development. Though its not functional in the true sense, it does provide the basic functionality like saving and opening (albeit to the same file)... Currently only the text is serialized... The project (VS 2008) is attached Note that the usage of the Hyperbolic tree and its code is under the Codeplex License terms Share this post Read More...
|
-
Now thats what I call WOW ... For .NET developers this is like getting hold of the holy grail :) ... " We'll begin by offering the source code (with source file comments included) for the .NET Base Class Libraries (System, System.IO, System.Collections, System.Configuration, System.Threading, System.Net, System.Security, System.Runtime, System.Text, etc), ASP.NET (System.Web), Windows Forms (System.Windows.Forms), ADO.NET (System.Data), XML (System.Xml), and WPF (System.Windows). We'll then be adding more libraries in the months ahead (including WCF, Workflow, and LINQ). The source code will be released under the Microsoft Reference License (MS-RL). You'll be able to download the .NET Framework source libraries via a standalone install (allowing you to use any text editor to browse it locally). We will also provide integrated debugging support of it within VS 2008. " Read the complete post at Scott's blog Share this post Read More...
|
-
Viewport2DVisual3D .... this new feature makes things a lot easier in the 3D world.. What this enables is putting interactive 2D on 3D. This makes things like having a textbox in 3D a breeze... < Viewport2DVisual3D x:Name = " vp2d_multiple_children " Geometry = " {StaticResource mesh} " > < Viewport2DVisual3D.Material > < DiffuseMaterial Viewport2DVisual3D.IsVisualHostMaterial = " True " Brush = " White " /> </ Viewport2DVisual3D.Material > <TextBox /> </ Viewport2DVisual3D > One other thing is mapping 3D points to 2D is so much more easier... Earlier on I had a post on mapping a mouseclick on a 3d model to a 2d coordinate. This involved using some barycentric coordinates and such... Now all you need is call e.GetPosition(relativeTo) in the mouse event handler... tada!!... your coordinates are ready... so using this new stuff i created a simple app for keeping track of your travels. right clicking on the globe puts a tag on the globe. Clicking on the Read More...
|
-
In 3.0, we received a number of queries regarding creating plugins. So in 3.5 we got this in .. :) .. Creating an adding would bsically need the use of 3 dlls - System.Addin, System.Addin.Contract, System.Presentation The basic steps to create the addins involves creating a contract, then create the corresponding views and adapsters for both the host and the addin. So in total you will be creating 5 dlls in addition to the app and the actual addin. Even though this looks a bit overwhelming, its pretty simple. http://blogs.msdn.com/clraddins/ gives more information about creating addins. In order to try out this framework, I added the addin support to blogpad with the host being able to set text in the addins... So the app basically has an addin for a calculator (which can be removed) and an ad at the side... You can try out the code that is attached .. FYI, the ad plugin links to an xbap and this line is commented in code.. You might want to point it to a legit xbap to get this plugin working. Read More...
|
-
hmmm... that was one often requested feature. So to enable hyperlinks in RichTextBox all that is needed is to set the property IsDocumentEnabled on the RichTextBox. Type the following in XamlPadX and you have the hyperlink navigation working. < RichTextBox IsDocumentEnabled = " True " xmlns = ' http://schemas.microsoft.com/winfx/2006/xaml/presentation ' xmlns:x = ' http://schemas.microsoft.com/winfx/2006/xaml ' > < FlowDocument > < Paragraph > < Hyperlink NavigateUri = " http://club.live.com " > Live Games </ Hyperlink > </ Paragraph > </ FlowDocument > </ RichTextBox > A couple of things to notice here: 1> The Navigation is possible only on a Ctrl Click operation 2> There is no tooltip to indicate that navigation is possible. You could add this to the Hyperlink. A simpler alternative is to just subclass the Hyperlink and add the tooltip in the constructor public class MyHyperlink : Hyperlink { public MyHyperlink() { this .ToolTip = Read More...
|
-
Pavan has a nice post on creating baloon comments. The first thing that comes to mind on seeing the balloon comments is Comics. And guess what! thats exactly what I tried.. and presto You can get the original source code here . It overlooks positioning the arrows coming out of the comment boxes - this is a minor detail and I added a dependency property for this purpose. The update code is attached . As for the usage: < custom:BalloonDecorator Background = "Pink " PointerLength = " 30 " CornerRadius = " 5 " CornerPosition = " Right" .... /> Share this post Read More...
|
-
came across this xbap from Denis Dolfus . Its got some kewl animation and evasion techniques. Check it out here Share this post Read More...
|
-
A couple of weeks ago I had posted an entry about the WPF perf tools being part of the SDK.. One of the readers asked for a separate installable since the SDK is huge and downloading the SDK just for the perf tools really didnt make sense... So we listened, and the WPF perf tools are now available as a separate installable .. Download: x86 and x64 versions Share this post Read More...
|
|
|
|