• Shortcuts : 'n' next unread feed - 'p' previous unread feed • Styles : 1 2

» Publishers, Monetize your RSS feeds with FeedShow:  More infos  (Show/Hide Ads)


Date: Tuesday, 19 Jul 2011 00:00

King Of HeartsThis post is about scrolling in WPF and the egocentric DataGrid control. I’ll give the project background but if all you’re interested in is the final solution, scroll on down a bit. I’ll leave a trail of headers so you should be able to find your way easily enough.

The Project

I’ve been working on a little application to help track spells for my wife’s character in our weekly Pathfinder games (my character might find a use for it as well but that’s just gravy). Since I had already spent a couple months dinking around with acquiring (and normalizing into XML) the reference version of the spells, I figured all I really needed was a UI to present and track them. I mean, I have a strong object graph and a library of spells, UI is really all that’s left, right?

For the UI, I decided to lean on WPF—mostly so I could come to understand the many data binding techniques I’d learned at TechEd this year. Plus, I had some ideas of how I wanted to leverage a composite UI for the presentation. This turns out to have been an awesome idea and allowed me to do exactly what I wanted, though it sometimes took a while to figure out how to do the cool stuff.

As part of the project, I also wanted to get some experience with actually using MVVM in a live project and set myself the task of using as little code-behind as possible.

The Last Fly in the Ointment

As I said above, things went well. I had to learn my way around a few problems, but things mostly worked the way I thought they should and while the end result would be cleaner if I’d started out knowing what I know now, I’m pretty proud of the results. I got the UI to alter dynamically depending on whether the character class had Domains. Or bloodlines. Or neither. I had some fun building in filtering capabilities. And you can even choose the sources you accept into your spell list.

The one thing that had me tearing my hair out, in the end, was that the list of spells didn’t scroll right. Since the spells need to be divided by level, I have a ListView with a custom data template. Each item in the ListView is a whole level’s worth of spells. The custom data template has a WrapPanel for the level header information (spells per day, spell DC—things that vary by level) and then a DataGrid for the spall data itself. Here’s a screenshot if you’re curious:

Spell Manager Labeled Screenshot

For mouse wheel scrolling, if the mouse was on the level header (the yellow bit), or if you scroll all the way to the right where the DataGrid ceases to rule, it’d scroll just fine. Actually, that’s a lie. It’d scroll just fine once you turned off ScrollViewer.CanScroll on the ListView (if you don’t, then the ListView scrolls it in chunks, a level/item at a time).

This got very annoying because as far as I’m concerned, if there’s a scroll bar, the mouse wheel should move it. And since the list tends to be long, I was forever trying to scroll with my wheel.

Why This is Happening—Mad King DataGrid

By poking at it repeatedly with a debugger and wiring up random events, I came to understand that the DataGrid was eating my MouseWheel event. And since that’s the bottom control on the event route (WPF starts the event routing at the bottom of the tree), the MouseWheel wasn’t being seen by itself (the DataGrid), its parent (the StackPanel), or its parent’s parent (the ListView). My guess is that DataGrids expect to be the king of scrolling and figure they own the MouseWheel events because you, the developer, will only screw it up if they let you.

Where to Even Start—ScrollViewer

So I went digging to see if there wasn’t something I could do to wrest MouseWheel events from the DataGrid. It was clear that I’d need to do something to manually handle mouse events and, also manually, dictate scrolling behavior during same. The only control I could find that exposed the right methods is the ScrollViewer control as explained in this Stack Overflow answer. That’s exactly what I need, but to use it, I’d need to insert a ScrollViewer into the control hierarchy. And the only place to do that, such that it’d actually work the way you’d expect, is to insert it into the ListView somehow. This turned out to be trickier than it looks.

Where to Finish

My initial impulse was to replace the ItemsPanel on the ListView. Unfortunately, the ItemsPanel has to be just that—a panel. ScrollViewer isn’t a panel and any panel you insert there is going to have the same problem as the ListView itself. It took me a while to work out how to do it (because the documentation for template-type properties is long on detail and short on information), but I finally figured out that overriding the ControlTemplate was the way to go. A little back and forth and I came out with this simple-after-the-fact solution.

	<ListView Margin="8,155,8,8" ItemsSource="{Binding Source={StaticResource characterViewModelClassesViewSource},  Path=SpellLevels, UpdateSourceTrigger=PropertyChanged}" ItemTemplate="{DynamicResource spellLevelDataTemplate}"  ScrollViewer.CanContentScroll="False" IsTextSearchEnabled="False" Name="spellsListView">
		<ListView.Template>
			<ControlTemplate>
				<ScrollViewer PreviewMouseWheel="ScrollViewer_PreviewMouseWheel">
					<StackPanel IsItemsHost="True"/>
				</ScrollViewer>
			</ControlTemplate>
		</ListView.Template>
	</ListView>


With the ScrollViewer in place, the event itself was simple, too.

private void ScrollViewer_PreviewMouseWheel(object sender, MouseWheelEventArgs e)
{
	ScrollViewer scv = (ScrollViewer)sender;  scv.ScrollToVerticalOffset(scv.VerticalOffset - e.Delta);
	e.Handled = true;
}


If you actually followed the Stack Overflow link, you’ll recognize that I lifted the code pretty much wholesale.

So now, my ListView eats the MouseWheel event (via PreviewMouseWheel), but only after it actually moves the scroll bar correctly.

Author: "Jacob"
Comments Send by mail Print  Save  Delicious 
Date: Friday, 20 Aug 2010 00:05

FlashlightWhile I prefer working through GP Web Services, sometimes the functionality you want/need simply isn’t there. Many people drop from Web Services directly to table access, but I prefer seeing if I can’t get what I need through eConnect instead. Generally speaking, I can.

Unfortunately, the eConnect SDK documentation is sparse and only really useful for simple cases. Raw schema files and cryptic explanations are par for the course and this can be frustrating.

Pulling a Customer Card

So, I’m working on an application that requires that I take a Universal Locator Id and walk that back to the customer I need to ship something to. For reasons buried in the depths of time, the UL is stored on the COMMENT2 field of the Customer Card. Since GP Web Services doesn’t expose COMMENT2 in its search criteria, I dropped back to eConnect.

Simple right? I mean, the request document has a “WhereClause” element for just that purpose so how hard can it be? Here’s the documentation:

WhereClause

string

1000

N

<blank>

Allows users to pass in a custom "where clause" built from columns of the parent table of the requested document type.


So I cranked up my eConnect library project and came up with the following code:

private RQeConnectOutType getRequest(string CustomerUL)
{
eConnectOut outDoc = new eConnectOut()
{
DOCTYPE = "Customer",
OUTPUTTYPE = 1,
INDEX1FROM = "A001",
INDEX1TO = "Z001",
WhereClause = string.Format("COMMENT2 = '{0}'", CustomerUL)
};
RQeConnectOutType outType = new RQeConnectOutType()
{
eConnectOut = outDoc
};
return outType;
}

The only problem is, this returns every customer record. All the time. And it does so for every alternative expression I could think of. Questioning my assumptions on this to get it to work was an exercise in futility.

And no amount of search-fu helped me find a satisfactory answer to getting this to work. As far as the internet is concerned, everybody who tries this either gives up or doesn’t have to be told how to get it working.

Getting it to Work

Well, I eventually got it to work, and I thought I’d share so the next schmuck who goes through this doesn’t have to suffer through the despair I did to get there (at least, not if their search engine of choice can point him here).

The key to this working is to tell eConnect that you don’t want to work from the “shadow” tables. What’s a shadow table, you ask? Well, I can’t be certain, but I think that it refers to the e_Connect_Out table stuck in your database by eConnect. This table has summary records that you might want to work with in eConnect, with details on where to get the full record. I can’t tell you for certain because the SDK documentation doesn’t actually have a section explaining shadow tables.

The problem is that when working with the shadow tables, things that aren’t in an index field aren’t really available for filtering purposes. Thus, my WhereClause referring to COMMENT2 doesn’t do a thing because the shadow table doesn’t know from COMMENT2. The fix for this is to use the woefully misnamed element “FORLIST”. Here’s what the documentation says:

FORLIST

i4

4

N

0

0=Return items from the shadow table. Use ACTION to specify the type of returned data.

1=Returns a list of items directly from the actual tables; does not use shadow tables

Well, hoodyhoo! That’s exactly what I needed (though I didn’t know it until I tried it). So here’s the code that actually works:

private RQeConnectOutType getRequest(string CustomerUL)
{
eConnectOut outDoc = new eConnectOut()
{
DOCTYPE = "Customer",
OUTPUTTYPE = 1,
FORLIST = 1,
INDEX1FROM = "A001",
INDEX1TO = "Z001",
WhereClause = string.Format("COMMENT2 = '{0}'", CustomerUL)
};
RQeConnectOutType outType = new RQeConnectOutType()
{
eConnectOut = outDoc
};
return outType;
}

I’ve bolded the only change. Not only does this work, but it works fast. So now you know. If you want your filter to work in the WhereClause and it just won’t take, try pointing it at the real tables. I know that “FORLIST” is the obvious place to do this, but I thought I’d point it out, anyway (in case I forget).

Author: "Jacob"
Comments Send by mail Print  Save  Delicious 
Date: Tuesday, 10 Aug 2010 22:05

Duct tape road fix.As you may have figured out from past posts, I like working with Dynamics GP Web Services when building integrations that involve our business systems. That isn’t to say that there aren’t rough spots occasionally. My latest wrestling match with it involved updating Sales Invoices. Since I couldn’t find information on this issue at all, I thought I’d post my struggle and solution for others in the same situation in future to find.

The Setup

We have multiple bins configured on our sales invoices so that we can coordinate our warehouse folks and get orders shipped quickly. That means that for each line on the invoice, inventory can come from one or more bins (if needed) to fulfill the order. Since GP isn’t very flexible in its automatic bin assignment, we have an addin that we run to allocate bins. I programmed the addin.

Sending a sales document through GP Web Services with multiple bins attached to each line item was impossible to do on Sales Orders because of a bug in the update procs that I found a couple months ago (where the bins simply aren’t updated). As a result, we have to wait until an invoice is created for the document to be able to assign bins through the web services. A pain, but not a huge deal, really.

The Specs

Dynamics version: 10.00.1368
SQL Server version: 2005
Visual Studio: 2010 (10.0.30319.1)
Target Framework: .Net Framework 3.5
Transport: WCF using basicHttpBinding

The Problem

The thing is, I was having trouble making my bin allocation re-entrant. It could be that you might want to run bin allocation twice on a batch of invoices if, say, you had shortages in the available bins on one or two orders but were able to move things around a bit to make it work. It seems reasonable. Then, too, we found that another process that was updating shipping dates on invoice batches was causing problems, as well.

A little experimentation showed that updating an invoice through the web services that already had multiple bins allocated caused Dynamics GP to lose track of the allocations entirely. Fortunately, it did so in such a way that the inventory wasn’t messed up—i.e. it reverted back to the bins they had come from. Unfortunately, I could find no way to allow my bin allocations to be re-entrant and/or for my batch date change application to touch my Sales Invoices without bad things happening.

I found that even if you sent an absolutely unaltered invoice back to GP in a web services update operation, it’d lose bin allocations if they existed—whether your update included those bin allocations or not.

The Solution

I finally got a wacky idea that turns out to work a dream. It’s less than ideal, but hey, it works without having to drop down to eConnect or anything even less friendly. The trick is to fake Dynamics out with a superfluous update if you have an order with bins already allocated. Here’s the code:

public List<CustValidationItem> CommitSalesInvoice()
{
OnCommitting();
GPService.SalesInvoice si = originalSalesDocument as GPService.SalesInvoice;
if (si == null)
{
si = new GPService.SalesInvoice();
}
else
{
int allocatedCount = si.Lines.Count(l => l.QuantityFulfilled.Value > 0M);
if (allocatedCount == si.Lines.Count())
{
fakeoutUpdate(si);
}
}

In this code, originalSalesDocument is completely untouched and exactly the invoice as read from the web service earlier. If you were to break after fakeoutUpdate() is called, the invoice would have no bins allocated for any of the line items.

Note that I have a potential bug in there if an invoice is ever partially allocated (because then allocatedCount would be less than the total number of lines), but I’m considering that a feature for now (because it will de-allocate all bin allocations on that invoice and send up red flags throughout our system).

And just to put all the cards on the table, here’s fakeoutUpdate in its entirety:

private void fakeoutUpdate(GPService.SalesInvoice invoice)
{
    // If bins are already allocated, the next update deletes the allocation regardless of what is sent.
    // This update is to de-allocate the order while preserving the bins we know about already so they'll
    // save properly later in the process.
    GPManager.Service.UpdateSalesInvoice(invoice, GPManager.GetContext(), UpdateSalesPolicy);
}

There’s another potential bug if you get another user updating the same sales invoice from a different machine between the time the fake is run and the actual update. Fortunately, the total time between the two updates is literally microseconds. Indeed, our order processor says that there is no noticeable difference in the time it takes to commit updates between the new process and the old one. Subjective, I know, but good enough.

The Takeaway

I find it odd that such simple and universal bugs have made it into the release of the product. It speaks poorly of the testing done at Dynamics headquarters. These aren’t bugs that should have been able to slip through a minimally competent QA process. It’s clear that nobody tested updating invoices in a multiple bin scenario. At least, not in a way that checked that the bin allocations survive the update.

I also find the lack of information out there disturbing. It makes me feel like I’m the only developer using Dynamics GP Web Services for anything beyond the most basic functions. I know that can’t be true, but you couldn’t prove it by the amount of chatter on the interwebs. I’ve noticed before that business line developers are under-represented out here and this reinforces that feeling. The only Dynamics blogs I’ve been stumbled across seem to be vendors and/or supply channel/party line outlets. These blogs talk enough about the abomination that is Dexterity, but almost none at all about alternatives like eConnect or GP Web Services.

Author: "Jacob"
Comments Send by mail Print  Save  Delicious 
Date: Thursday, 13 May 2010 02:52

I like the "My Network Places" functionality in Windows XP. The way I use Windows Explorer is to have mapped drives for high-use locations. "My Network Places" becomes a psuedo-"favourites" - linking to, for example, a folder where a third-party extract is dropped, or a shared folder from another department, or a folder used for backups but rarely accessed.

With that in mind I thought it would be handy to keep a copy of the UNC paths contained in "Network Places". There's a few tools that will allow you to print folder contents ("Network Places" is stored in the "NetHood" folder in your user profile) but that only resulted in the names, not the UNC paths.

Here's the VBScript I ended up cobbling together to save "My Network Places" to a text file, enumerating each item and getting the name as well as the UNC path. I hope this helps if, like me, you've ever considered just taking a screenshot of Windows Explorer to keep track of your network places:

Special Note: This works perfectly on my PC, however I can't take any responsibility for it working anywhere else. It's just a quick script that did the job for me, not a fully debugged application.

' ------------------------------------------------------------------------------
' Writes all folders/links in "My Network Places" on Windows XP to a text file
' Thomas Williams 13-May-2010

' adapted from http://www.tek-tips.com/viewthread.cfm?qid=1309939&page=9 and
' http://blogs.technet.com/heyscriptingguy/archive/2005/05/09/how-can-i-create-a-shortcut-in-my-network-places.aspx and
' http://msdn.microsoft.com/en-us/library/bb774004%28v=VS.85%29.aspx
' ------------------------------------------------------------------------------

Const NETHOOD = &H13&

Set objShell = CreateObject("Shell.Application")
Set objFSO = CreateObject("Scripting.FileSystemObject")

' file to write to (overwrite without prompting)
Set outputFile = objFSO.CreateTextFile("C:\Network Places List.txt", True)

' get the NetHood folder on Windows XP for the current logged in user
Set objFolder = objShell.Namespace(NETHOOD)

' loop through all items in NetHood folder
For Each objItem in objFolder.Items
    ' if the item is a link e.g. not "Entire Network"
   If objItem.IsLink Then
        ' get the link/shortcut for the item
       Set objLink = objItem.GetLink
        ' write to the output file, the display name of the folder, and the UNC path
       outputFile.WriteLine(objItem.Name & vbTab & objLink.Path)
    End If
   
Next

' close the output file
outputFile.Close

The tricky part was dealing with the list of items returned by Shell.Namespace and finding out how to get the link properties from a FolderItem...luckily I'm on first-name speaking terms with my friend the MSDN Library :-)

Tags: windows, script

Author: "Thomas Williams"
Comments Send by mail Print  Save  Delicious 
Date: Wednesday, 03 Mar 2010 14:06
our next meeting is tonight at 7pm at the MS offices (check out the TampaSLUG site for more info). Greg is bringing a us a talk which should coincide nicely with the talk I gave last month (even if you missed last month Greg's talk is still for those of you who want to learn).  If you have a desire to learn Silverlight, but don't know where to begin, or simply just want to get some background in it. This is the group and night for you! .

Greg is really knowledgaeble about Silverlight so this night aims to be a really good evening.

We will have pizza and soda, so plan on coming! BUT, there is one thing you must do! Register here --> http://tampaslug310.eventbrite.com/

Also as usual there will be a social afterwards which is a good place to ask the Silverlight gurus those tough questions..
Author: "Jay Kimble"
Comments Send by mail Print  Save  Delicious 
Date: Tuesday, 23 Feb 2010 02:29

Tab Scope is a very handy Firefox add-on that shows a pop-up preview of a tab's contents when hovering over a non-selected tab...oh, a picture probably will say it better:

The developers have clearly put a huge amount of work into Tab Scope over the years and have largely got it right, and in addition to a preview image, there's a couple of controls like back, forward, refresh in the pop-up itself. After using Tab Scope version 0.3 with the fx4 theme for a couple of weeks, there's a few things on my wish list, however:

Left-clicking on the actual preview image does nothing: it should at least act like a left-click on the tab, and switch to the tab. Wish 1: Left-clicking on a preview image should switch to the tab.

When zooming, left-clicking on a link or button in the preview image opens the link: a nice touch...that I discovered entirely by accident. I feel that the negative (e.g. hit-and-miss clicking on microscopic text) outweighs the positive (e.g. navigation from within a preview window). Wish 2: In line with wish 1 above, left-clicking on a zoomed preview image should also switch to the tab.

When zooming, there's no horizontal scroll: the zoom is not particularly useful on wide, centred designs:

Wish 3: An alternative might be to zoom the entire page, like a bigger version of the non-zoomed image preview (you'd lose the ability to click on links).

Wish 4: OK, I'm into overtime here because in most stories you're only granted 3 wishes. I'd love to see Tab Scope work with the Smart Stop/Reload add-on, which shows the stop button when the page is still loading, and the reload button when the page has finished.

When zooming, the vertical scroll is not easily discoverable: you can see from the zoomed image above that there's no scrollbars, but if you scroll the mouse wheel when hovering over the preview, the preview will scroll vertically. This is another feature I found by accident. Wish 5: make scrolling more discoverable (hmmm, I'll leave the implementation to someone with more imagination than me).

Wish 6: The close button should probably be in the top-right corner of the pop-up, which matches where the close button would normally be on the tab. This may not suit everyone's themes, though. You could go even further and specify that the back and forward buttons on the pop-up preview were styled like your theme's styles, but I think that's probably asking a bit much :-)

Wish 7: My last wish is purely aesthetic - make the pop-up preview joined to the tab somehow. In the zooomed preview image above, it looks like the pop-up is joined to the second, active tab ("Google"), instead of the first tab ("Tab Scope").

OK, I'm done. What do you think? Would you use Tab Scope, and given more wishes than Aladdin, what would you improve?

Tags: firefox, tab scope, usability

Author: "Thomas Williams"
Comments Send by mail Print  Save  Delicious 
Date: Friday, 12 Feb 2010 01:17

I'd never run into this one before and am not likely to again, but the fix is pretty simple and worth posting for my own reference (and I hope it helps anyone googling for it too).

The problem occurs in SQL Server 2005 or SQL Server 2008 when you try and select a DISTINCT range of values from a sub-query that uses a UNION or UNION ALL to union two columns with different collations. The problem may occur if the collations are set differently at a database level while unioning two tables from different databases, and also at the column level within the same database. As with other "Cannot resolve collation conflict for XXX operation" errors, the fix is the same - convert the offending columns to the same collation using COLLATE DATABASE_DEFAULT:

--Step 1: create two similar tables with columns with different collations
DECLARE @temp1 TABLE (
    [Test1] NVARCHAR(100) COLLATE SQL_Latin1_General_Cp1250_CS_AS
)
DECLARE @temp2 TABLE (
    [Test2] NVARCHAR(100) COLLATE Icelandic_CS_AS
)

--Step 2: put in some values
INSERT INTO @temp1 VALUES(N'Falcon')
INSERT INTO @temp1 VALUES(N'Eagle')
INSERT INTO @temp1 VALUES(N'Tomcat')

INSERT INTO @temp2 VALUES(N'Mirage')
INSERT INTO @temp2 VALUES(N'Viggen')
INSERT INTO @temp2 VALUES(N'Harrier')

--Step 3: THIS WILL CAUSE A "Cannot resolve collation conflict for DISTINCT operation" ERROR
--Comment the following out to run step 4
--get distinct values from both tables, joined using UNION ALL in a subquery
SELECT DISTINCT [Test]
FROM (
      SELECT [Test] = [Test1] FROM @temp1
      UNION ALL
      SELECT [Test2] FROM @temp2
     ) I

--Step 4: the fix is to convert the columns to same collation using COLLATE DATABASE_DEFAULT
SELECT DISTINCT [Test]
FROM (
      SELECT [Test] = [Test1] COLLATE DATABASE_DEFAULT FROM @temp1
      UNION ALL
      SELECT [Test2] COLLATE DATABASE_DEFAULT FROM @temp2
     ) I
 

Tags: sql server, collation, code

Author: "Thomas Williams"
Comments Send by mail Print  Save  Delicious 
Date: Tuesday, 09 Feb 2010 13:59
Tomorrow, is our next meeting at 7pm at the MS offices (check out the TampaSLUG site for more info). I want to stress that this is a very basic 101 type of talk. If you have a desire to learn Silverlight, but don't know where to begin, or simply just want to get some background in it. This is the group and night for you! The night will be focused on a couple topics, but it's mostly about building forms with Silverlight and binding data to those forms to make your life easier (SIlverlight is actually easier in many respects from what you are used to if you are a web developer).

BTW, I hear its the speaker's first presentation on Silverlight so at the very least it will be fun to see him sweat.

We will have pizza and soda, so plan on coming! BUT, there is one thing you must do! Register here --> http://tampaslug0210.eventbrite.com/
Author: "Jay Kimble"
Comments Send by mail Print  Save  Delicious 
Date: Sunday, 10 Jan 2010 21:58

I want to blog a quick reminder to my readers the first (official) meeting of the Tampa SLUG (Silverlight User Group) is Thursday, Jan 14th, 2010 at the Microsoft offices in Tampa. We’re starting the group off with a series of topics that will be good for beginners. Here’s the info on the first topic:

Introduction to the Silverlight Workflow: One of the promises of separating business logic from the display is that designers and developers can more easily work with each other to create an application. Learn about strategies to actually deliver on this promise and make your data and logic more designer friendly.

This topic will be done by Bill Reiss (Silverlight MVP). We are priviledged to have Bill --the first ever Silverlight MVP-- as a part of our group. Bill could present every month, but he won’t. He will be around to help out (as well as correct me and others who will be presenting). If you plan on coming please RSVP at http://silvertb.eventbrite.com/ so we can know how many folks are coming.

You can read up more about our group here at http://www.tampaslug.net.

Author: "Jay Kimble"
Comments Send by mail Print  Save  Delicious 
Date: Monday, 30 Nov 2009 04:31

I recently discovered the new Google Reader "Explore" section, just above my subscriptions in the left-hand panel:

Using it like my screenshot above - not expanded - means that when I click on the "Explore" text, I get an endless, combined feed of everything Google Reader thinks I might like (there's actually been some good stuff there too) for the price of one line of text.

This is much handier than viewing a list of feed titles using the old "Browse for stuff" link and having to make a decision to even click on a feed based on the title, author and number of subscribers.

Well done Google for a smart, non-obtrusive way to help users find more reading.

Tags: google reader, ui, design

Author: "Thomas Williams"
Comments Send by mail Print  Save  Delicious 
Date: Tuesday, 03 Nov 2009 14:20

We are not cancelling though. Greg Leonardo has graciously offered to step in and give us a talk he calls “Impromptu Sketchflow.” Should be fun. Everything else is the same (7:00pm for the speaker/Pizza at 6:30pm.. MS Offices)

Author: "Jay Kimble"
Comments Send by mail Print  Save  Delicious 
Date: Thursday, 29 Oct 2009 03:21

Next Tuesday, November 3rd, we have Jim Zimmerman coming in. Jim is talking about a subject that in my opinion is important to both developers and designers. Jim will be showing us how to do something that both areas of app development need to know how to do. He’s teaching us how to take a Photoshop file, slice it up into usable web graphics and then build html and CSS to create a web layout from the original file which is perfect for an ASP.NET Masterpage.

You might wonder why I think this is so important. The reason is simple. In today’s world of app development, a designer who just produces graphics and little else will someday go the way of the designer. As well as a developer with no design skills is equally on its way out. We need to know something about each other’s expertise, and be able to function in the tools of the “other half.”

Anyway, Pizza will hopefully arrive around 6:30-6:45pm. We will start the session at 7:00pm.

Author: "Jay Kimble"
Comments Send by mail Print  Save  Delicious 
Date: Wednesday, 07 Oct 2009 06:56

vslive Thanks to everyone who came out to my two VSLive sessions today.  You can find the slide decks and full source code posted in my download section.  Please note that in order to save some bandwidth, I didn’t include the 125MB video file I used in my examples, but you can download that separately here.  Just unzip and copy to the Media and GPUAcceleration sample directories and build the project.

I welcome any and all questions, and especially comments/critiques.  As a speaker, I rarely, if ever, receive any formalized feedback from the session organizers, so I’d love to hear what those in attendance thought of my sessions.  Good or bad, please send it along!  Thanks!

Cross Posted from www.brianpeek.com.
Author: "Brian Peek"
Comments Send by mail Print  Save  Delicious 
Date: Sunday, 04 Oct 2009 07:16

vslive Anyone out there heading to VSLive! Orlando this week?  I will be giving two introductory sessions on Silverlight as listed below:

Getting Started with Silverlight
Tuesday, October 6, 10:30am

Microsoft Silverlight allows developers and designers to build rich cross-browser and cross-platform applications for the Web using the same tools and technologies that are familiar to .NET developers.  This session will cover the basics of Silverlight, including basic XAML, the tools that can be used to create Silverlight applications, the controls available in the Silverlight framework, and pros and cons of Silverlight vs. other web technologies, all while building a few very simple applications demonstrating the power of the framework.

Silverlight Controls and Animations
Tuesday, October 6, 12:00pm

The Microsoft Silverlight framework contains an assortment of pre-built controls that can be used directly by your applications.  Developers can also create their own custom controls to fit their requirements.  In addition, Silverlight can be used to create animations that are simple or extremely complex, from pulsing buttons to 3D movement.  This session will demonstrate how to use the most common and important controls, as well as how to create custom user controls, along with demonstrating how XAML, Visual Studio and Expression Blend can be used to create animations that will spice up any application.

If anyone will be attending the conference, let me know so I can say hello!

Cross Posted from www.brianpeek.com.
Author: "Brian Peek"
Comments Send by mail Print  Save  Delicious 
Date: Friday, 18 Sep 2009 17:56

c9logo The third episode of my Coding4Fun Show, live from Las Vegas, is now up on Channel 9.  In this episode I interview Rick Barraza of Cynergy Systems, who has put together several very unique applications and accompanying tutorials demonstrating advanced rendering techniques using Silverlight 3.  During the show, we discuss Silverlight 3, UX design, and the three demos he has created showing off advanced rendering techniques.  For more on how these amazing demos were made, check out his (currently) three part series at his blog:

You should see the video below if you have Silverlight installed, otherwise head over to the episode on Channel 9 to watch and download in a variety of formats for offline viewing.


The Coding4Fun Show: Advanced Rendering with Silverlight, Rick Barraza

 

A big thanks to Rick for taking a few minutes out of his vacation to chat with me.  Enjoy!

Cross Posted from www.brianpeek.com.
Author: "Brian Peek"
Comments Send by mail Print  Save  Delicious 
Date: Wednesday, 16 Sep 2009 00:09

The next TRUIX meeting is October 8th. We are still finalizing some of the details for the night, but we will definitely be continuing tutorial on building a UI (using our www.TampaUx.net site). We also plan on bringing you some material for the Silverlight 3/Expression 3 launch.

Things will get started at about 7:00pm (with doors opening up at 6:30pm).

Sorry it’s taken us so long to get a next meeting (we’ve had a lot of scheduling conflicts to work through of our core team).

PS. the meeting after this one will be on November 3rd and we’ll have Jim Zimmerman talking to us about a topic that is definitely in the Dev-Signer realm! Stay tuned!

Author: "Jay Kimble"
Comments Send by mail Print  Save  Delicious 
Date: Monday, 14 Sep 2009 09:54

I love the DailyWTF blog and recently had a WTF moment of my own while signing up at the Blockbuster (Australia) website:

 

In my case the password wasn't long enough, but Blockbuster effectively "threw the book" at me and dumped all the password error text onto the screen.

I read and re-read the highlighted text but it still didn't make sense, especially considering I didn't use any non-alphanumeric characters. If something should "contain at least zero" then it could also be written "should not contain" which might have come off better.

Tags: wtf, blockbuster, design, ui, error

Author: "Thomas Williams"
Comments Send by mail Print  Save  Delicious 
Date: Thursday, 10 Sep 2009 14:27

I’m in the process of building a new ActionResult for ASP.NET MVC. This new ActionResult will allow you to transform data into a PDF, RTF, or HTML (it uses iTextSharp behind the scenes, and yes, I have a working prototype right now that isn’t all that useful yet.. and you have to know way too much in order to use it as of this time).

Essentially what I want to do is use any view engine that the programmer chooses and convert the resulting html, xml, or regular string data into a file that gets pushed to the browser. All this works for all of the alternative engines, but the default engines doesn’t work… so, without further adieu

Challenge #1: WebFormViewEngine ignores the TextStream you give it

Actually this might be the only challenge here. I tried numerous solutions.. none of which worked. I finally cracked open the MVC source code and determined that I needed to inherit form their class and do some overriding… In my API I created BufferedViewPage, and BufferedViewPage<T> so I could intercept the RenderView code. Here’s a copy of my current (in progress) version of BufferedViewPage:

1: public class BufferedViewPage : ViewPage, IBufferWebFormView 2: { 3: public TextWriter Writer { get; set; } 4:  5: public override void RenderView(ViewContext viewContext) 6: { 7: ViewContext = viewContext; 8: InitHelpers(); 9: // Tracing requires Page IDs to be unique. 10: ID = Guid.NewGuid().ToString(); 11: var wfv = viewContext.View as WebFormView; 12: var page = (wfv!=null?wfv.ViewPath:""); // View should always be WebFormView 13:  14: if (viewContext.ViewData["____writer"] != null) 15: { 16: Writer = viewContext.ViewData["____writer"] as TextWriter; 17: } 18: ProcessRequest(new HttpContext(new simpleWR(page, viewContext.HttpContext, viewContext.HttpContext.Response.Output))); 19: if (Writer != null) 20: this.Render(new HtmlTextWriter(Writer)); 21:  22: } 23: }

You will see that I’m injecting a new writer into the ViewData (I’ll eventuually come up with a better mechanism, but it works for now). My code for the most part copies what the standard WebFormViewPage does except that you’ll see that if the page is a WebFormView it runs Render after running ProcessRequest. I’m not sure if this is problematic or not, but it works! Before I release the actual library I will probably clean this up quite a bit (this is mainly an exercise in helping anyone who wants to use the WebFormViewEngine, but somehow capture the result and do something else with it..

BTW, the part of the code here you don’t see is that before I render I make sure buffering is on and then I clear the response text after generating this (which clearing the response was about the only thing I could do.. that generated data in HttpContext.Current.Response.Output is lost to you… at least I couldn’t find a way to get at it…)

Author: "Jay Kimble"
Comments Send by mail Print  Save  Delicious 
Date: Thursday, 03 Sep 2009 17:43

As you may be aware Scott Hanselman’s 2009 Ultimate Developer and Power Users Tool List for Windows came out yesterday. If you are like me you end up pooling through the list especially the new stuff to see if there is something cool that somehow you missed.

I found an item on the list that answers something I think I have been looking for (but not for me), but before I go on I need to give you some background (as usual).

Kevin D. Wolf (aka ByteMaster) and I have been talking over the last several months on all things Ajax. We’re both pretty deep on the topic of Ajax (Actually Kevin is deep on a number of topics), and we’re both pretty opinionated about a few things (I know you are shocked that I would say that about myself).

One of the things I’ve sort of been looking for is something that makes it easy for someone to write Ajax. The new Blend Skecthflow stuff is a HUGE game changer, but if what I want to write is Ajax then after using Sketchflow I’m back to the drawing board.

Interractions in Ajax.. found!

So yesterday, I was browsing the Hanselman list and I found a side reference to a tool to watch called “IxEdit.” All I can say is WOW! [Personal Note: Diane Leeper download this now! I think you could have some fin with this…] Their video tells it all, but I will tell you what I think is cool about it.

You create a page and add references to jquery, jquery ui, and their ixEdit script as well as a few CSS. Once you do this the page launches with a movable dialog. This new dialog let’s you create Ajax/Web 2.0 (more the latter) interactions with your page all by simply playing in their GUI. Really, really cool! Now they don’t do everything, and in fact from what I saw of the tool you can’t set up to make calls back to the server (but I could see something like that being set up, and am starting to think about it). Once you are satisfied you can “save and reload” which reloads the page and applies your designed interaction (so now you can see how it worked).. something not look right simply edit the interaction to tweak it’s setting.

When you are done it will help you deploy the script, so now you have designed JS code with out actually writing a line of code! Really, really cool, IMO!

[I spent a couple of hours looking for pictures to fancy this up a little.. I run a UI/UX users group for crying out loud.. I need to get better at that, so sorry my post is bland.. I’ll try to follow up with something more graphically pleasing]

Author: "Jay Kimble"
Comments Send by mail Print  Save  Delicious 
Date: Friday, 14 Aug 2009 22:16

logo Is there anyone in or around the Las Vegas area between September 7th and September 12th that would like to be my guest for an episode of the Coding4Fun Show?  I’ll be in the area for the week and would love to do an in-person show with anyone doing a cool project with Microsoft technologies.  If you’re interested, please contact me so we can set something up.  Maybe you’ll even get a free lunch out of it.  :)  Thanks!

Cross Posted from www.brianpeek.com.
Author: "Brian Peek"
Comments Send by mail Print  Save  Delicious 
Next page
» You can also retrieve older items : Read
» © All content and copyrights belong to their respective authors.«
» © FeedShow - Online RSS Feeds Reader