Csharp

There are 5 entries for the tag Csharp

How to preserve state across pages in a Windows 8 app

When designing a Windows 8 app, you need a way to preserve the state of various items as you navigate from page to page. Windows allows this using the pageState dictionary - a dictionary that can contain any serializable object. If you're a web programmer, you can think of this as similar to using a session variable. Today I'll add this to the cascading ListBoxes shown earlier. You can download the code for that project at ListBoxDrillDown.zip. First, we'll add a navigation button to the page. Put ......

Using cascading ListBoxes to display hierarchical data in Windows 8

When you're dealing with hierarchical data (a tree-like data format such as folders that have sub-folders that have subfolders, etc.) you have to come up with an organized way of displaying it. You could create a tree view, similar to how Windows Explorer displays folders, but I wanted to try something different in Windows 8 - cascading ListBoxes. The user selects an items in a ListBox, and then a new ListBox appears to the right showing the sub-categories. This continues as long as there's data ......

Retrieving a list of eBay categories in a .Net 4.5 Windows Store App

Previously I wrote a post on how to get the eBay category list using their .Net SDK. I wanted to try doing the same thing in a Windows Store App for Windows 8 using Visual Studio 2012, but quickly ran into compatibility problems since the DLLs are compiled for .Net 2.0. I could have either changed the targetted framework, or attempted to re-write the DLLs, but neither sounded particularly exciting, so I simply decided to fall back to using a simple URL request and parsing it via Linq to XML. As mentioned ......

Retrieving a list of eBay categories using the .NET SDK and GetCategoriesCall

eBay offers a .Net SDK for its Trading API - this post will show you the basics of making an API call and retrieving a list of current categories. You'll need the category ID(s) for any apps that post or search eBay. To start, download the latest SDK from https://www.x.com/developer... and create a new console app project. Add a reference to the eBay.Service DLL, and a few using statements: using eBay.Service.Call; using eBay.Service.Core.Sdk; using eBay.Service.Core.Soap; ......

C#–Using a delegate to raise an event from one class to another

Even though this may be a relatively common task for many people, I’ve had to show it to enough new developers that I figured I’d immortalize it… MSDN says “Events enable a class or object to notify other classes or objects when something of interest occurs. The class that sends (or raises) the event is called the publisher and the classes that receive (or handle) the event are called subscribers.” Any time you add a button to a Windows Form or Web app, you can subscribe to the OnClick event, and ......