-
Writing my first windows 8 Metro App
Posted on April 23rd, 2012 by alfredo
Hi Everyone,
Today I got started building my first windows 8 app. Decided that I wanted to write a standard WPF MVVM app and try the javascript interactions later. Loaded my windows 8 image created a project and downloaded Prism to get started. I was surprised while adding the dll’s to prism that they do not work with windows core which is the framework that metro apps run on that. Realized that I’m going to have to be crafty and just take the exact part of Prism and adapt them.
Opened expression blend created a project from a template to get started.
First thing to surprise me was to see that the toolbar is completely gone replaced by the appbar. They work the same way therefore more of an inconvenience of recognizing what the name of the component is.<appbar grid.column="0" grid.row="0">
<stackpanel>
<button horizontalalignment="Left" verticalalignment="Top">
<ellipse
Height=40tWidth=40
StrokeThickness=3
Stroke={StaticResource ApplicationTextBrush}/>
</button>
</stackpanel>
</appbar>
After that the next item that stomped me was when I tried to look for icons clicling on any picture takes me to a full screen method in which at the moment scrolling did not work on the folder that I was. Weird behavior kept me having go back and forth between the folders on the desktop and the metro start page…
While doing this I had my ui freeze causing a restart. Which is okay since its a beta preview.
A cool thing that I noticed is the new standard template breaks your app into folders Assets, Common, DataModel. If you add a xaml resource into the Common folder gets automatically added has a merged dictionary on the app level.
After adding the shared dictionary I wanted to add a textblock surrounded by a circle I tried to copy some old code using the label type to discover that it no longer exists.
Got the same effect from using:
<button>
<border horizontalalignment="Center" verticalalignment="Center" width="40" height="40" borderbrush="{StaticResource ApplicationTextBrush}" borderthickness="3" cornerradius="20"><textblock horizontalalignment="Center" verticalalignment="Center">40 F</textblock>
</border>
</button>
Since I was using it a bunch of places decide to make it a global resource to find out that the syntax for declaring types has changed from:
{StaticResource {x:Type Button}}"
To be more similar to what is used in Silverlight which can be read on this link:
Which requires to either create and converter for similar functionality or reference directly from the based template of the controls which is what I did by doing:
BasedOn="{StaticResource AppBarButtonStyle}"At the end in order to substituthe contentcontrol behavior that I would normally use a label for used a contentcontrol which made the button look the way I desired.
Another point to make to change the application loaded frame you want to go to app.xaml.cs -> protected override void OnLaunched(LaunchActivatedEventArgs args);
Overall so far got quite some progress on this. Like the new setup for the project. Feel like sometimes while testing the os crashes a bit much and I need to more exploration of all the controls(ToggleButton rock). Added some resources on the button and will keep making post has the application progress and post some images later. At the end some links to a few resources.
-Alfredo Out
Icon Resource
I’m using the ones from this website but you can also use the ones from the phone.
http://www.iconsforwindows8.com/ -
Xaml DataBinding to current datacontext
Posted on March 21st, 2012 by alfredo
My new job has me doing a ton of xaml i have a few interesting cases that i believe i should document before i forget how to do them.
First one was how do i Bind to the current Context after a few attempts couple of bings search got to this page and he had an answer for my problem.
http://www.developmentalmadness.com/archive/2009/08/26/xaml-binding-to-the-current-datacontext.aspx
Its pretty simple you just do {Binding} with nothing else in it.
Come next day to work realize that now i need a converter since we want different text to the one provided by the enum. To my surprise what i would expect {Binding, Converter={StaticResource myconverter}} would not work. So i started trying different possibilities made an explicit binding. Then Started thinking and decided well i’m just binding to my datacontext. So ended up with the following.
RelativeSource="{RelativeSource Self}"
Path="DataContext"
Converter="{StaticResource myconverter}"
ConverterParameter="Parent" />I feel like this is a case in which the xaml its really ambiguose and in future generations maybe the should create a keyword like context or what not to be able to change it.
Hope this helps.
-
How things are going current projects and sorry for the lack of update
Posted on March 7th, 2012 by alfredo
Hi Everyone,
How come I have dissapeared for a few well the new contractor life and settling into the new pace has taken a bit more of me than I expected. On the good news Im a lot happier than I was in the sept – january time frame and gainfully employed.
I’ve been doing a lot of WPF for two reasons one i’m studying for a cert and second its what i’m currently doing at work.
I’m hoping to be a lot more active this month and bring some update to my old projects
- There is no place for gnomes needs a new scoreboard and want to do an add based version
- Reddit Screensaver needs and update and i want to transform it into a MMVM app
- HDR raw want to try out some new formats in particular for the new sony lines is anyone still using this paint.net plugin??
I have been working on a Platform game aussie puncharoo probably for almost a year this weekend im going to commit to getting some progress and uploading a demo. Hoping to finish this project in the month of march to move to some ideas that i have to start my own business.
In terms of the blog im going to install win 8 today and then start describing the construction of an app that i will be work on a bit each day is going to be called contract manager and the purpose its to help you be a contractor on yourslef and keep track of everything that is going on in the life without a mother company
Happy Coding
-
New Year And Interesting Changes
Posted on January 23rd, 2012 by alfredo
The new year came in and few things have changed in my life for once. I decided to resign at Microsoft to take care of some personal issues. At the moment i ‘m still dealing with the change of moving from the workforce into a more personally driven situation.
In part due to my new found time I have been taking a look around at the new technologies that are coming and I’m convinced that this year is going to be the the year that html 5 blows up our minds. Perusing the web I found this two web sites and they did just that.
http://www.kevs3d.co.uk/dev/
He shows his 3d library and creates some interesting demos is worth looking at it.http://apps.nahklick.de/cnc/
This one on top recreated c&c in html 5 showing off the possible gaming capabilities of the environment.Seeing this type of technology advancements have made me question two things
First – What the heck have I been doing in this last couple of years since it made me realize I’ve been not contributing much.Second – As software developers we might actually be a bit out of focus with what is needed to advance society. We are spending our time creating software for advertisement, games and advancing it day to day but leaving behind many fields like infrastructure creation, economics , resource distribution , medicine with only a few advancements.
In a lot of cases when we have approach this field due to the constraint of money we have become part of the system. Like in medicine a lot of the Emr or bi systems are not for the betterment of the patient or to help the provider make less mistakes. But to enforce that correct billing is being done to the Insurance companies.Which brings me to the point maybe for the next year computer engineer / scientist should spend at least some of their time helping another industry that is not their own
. Best of wishes on the new year.
Alfredo
-
Xna Resources collected over time
Posted on October 25th, 2011 by alfredo
A list I’ve compiled over the years let me know if you got any more that are useful.
3d models
http://www.blendswap.com/3D-models/characters/cartoon-character-pack-1/
Free game 2d art for game developers and indies
Website to look for game inspiration:
http://www.freewebarcade.com/game/jezzball/
Three hundred game designs
http://www.squidi.net/three/index.php
Tool used to pack the sprites together:
http://spritesheetpacker.codeplex.com/
Free sprites
http://www.dumbmanex.com/bynd_freestuff.html
Shooter Game tutorial covers the basics
http://create.msdn.com/en-US/education/tutorial/2dgame/drawing_user_interface
Map Editor
physics engine for Silverlight and XNA
http://farseerphysics.codeplex.com/
Samples
http://farseersimplesamples.codeplex.com/
A Platformer tutorial using farseer.
-
What To Do When Inheriting A Code Base: Part 2 Understanding The System
Posted on October 7th, 2011 by alfredo
Alright Last Article we got the code base working and now we are ready to actually understand what our system does. The first step that I take is to not look at the provided Diagrams for the project. Why you may I ask because I have found that most of the time they are not completely correct which only causes confusion when you don’t know the system. So what would I do:
First check if I have a functional environment that I can thinker with. If I do then I try to figure out what is the main point of entrance for the main function of this system and what is the output the orange boxes. After Identifying that I try to find Where does the workflow happen and this I what I really care about.
By Watching the Workflow happen slowly either debugging or reading a log in verbose you can get a pretty good picture of what goes on in the system. This is really easy to do on WCF service and SQL in particular. In SQL people have a task table which is a common pattern well lets place the profiler to see the changes then make sense of what all that means. On the WCf service watching the messages come in and the responses it gives should give a fairly clear idea of what the routing it looks like.
After you understand the system routing is easy to dissect what happens in each component in a need to know basis.
Normally after I understand this I look at the documentation and see how close it is to what I understood from analyzing the system.
To understand the support system to me is important to isolate them and see them individually to be able to gather the reason for them and not just the side effects they cause or the support they give.
This is a really time consuming action and you should document everything you find during this for your own sake.
-Alfredo Out
-
What To Do When Inheriting A Code Base: Part 1 Inspecting the code
Posted on August 3rd, 2011 by alfredo
Hey Everyone,
I’ve been on more than one occasion on the situation in which I inherit a gigantic code base and its my job to support it and write some new functionality for it. I want to outline a few steps and practices I like to follow in order to get to the point that I’m confident making changes to the system in place. Note is that I use MS products in most of my development so I’m doing the article with those in mind.
My Steps are the following and I will discuss them in different articles.
1.Inspecting the code
2.Understanding the system
3.Preparing to make changes.
-Legacy
-NonLegacy1.Inspecting the code base
A.Create A New BranchMaking a new branch allows you to be able to check out files and work with them in a manner that is easy to see the changes you have done. When you actually got something that is worth you can reverse integrate into the main branch and delete yours.
B.Make sure the code compiles on the first download or lets you know how to set up the machine.
If the projects has a dependency check script run it. If it does not this is the first thing that needs to be done create a script that looks into the build machine and makes sure that all the dependencies that are needed for compilation are install and in the right place in reference with the script. By dependencies I mean libraries or GAC dll’s or simply cross compile configurations in your settings. In the case that the script is not provided a bit of investigative work will have to occur inside of the compilation errors which leads to the next point.
Make sure that all the projects that I have been given compile. It’s my practice to actually have a local compile script. This script just makes an entire build of all the project one for VSTF using batch could look as follows:
for /R %%i in (*.sln) DO (
REM echo %%i
msbuild /clp:ErrorsOnly /nologo "%%i"
)In the case that compilation is not occurring I make a list of all the problems and try to see which ones group together for example a library is missing. An important part during this step is to look out for orphaned solutions. If proper procedure are not followed sometimes in the branch you can find solutions that are no longer used. There is no easy way of finding this out. Except opening the projects and see duplicated projects in a solution.
C.Make sure that the leftover solution bindings in visual studio are correctly installed.
Try editing a file in each of the projects that are relevant and see if you get auto check out in the IDE if it does not work. You need to refresh the bindings.
Todo this follow this steps :
Open the solution
Go File>SourceControl>Change Source Control Remove the bindings
Then Go back to the same location and on the screen that lets you bind per project do binding for each one of them and the solution
CheckinD.Make sure the unit test runs
You can do it by following the steps to compile but using the mstest tool on the mstest projects the files should be the same is normal that some dependencies on the test project might be broke and some investigation will need to happen.E.Create a dependency script Now that you went through all the work and figure what needs to be installed in a machine make it easy for everyone else. My example of that script in batch checking for Pex to be installed.
REM VALIDATING DEPENDENCIES TO BE ABLE TO COMPILE CODESIGN SET /a NumberOfErrors = 0
SET /a NumberOfErrors +=1
Echo %NumberOfErrors%
del temp1.txt temp2.txt
REM CHECK FOR PEX
reg export HKEY_CLASSES_ROOT\Installer\Assemblies\Global temp1.txt
find "Microsoft.Pex" temp1.txt
IF %ERRORLEVEL% EQU 0 (
@ECHO PEX INSTALLED
)
IF %ERRORLEVEL% NEQ 0 (
@ECHO PEX NEEDS TO BE INSTALLED DOWNLOADED FROM http://research.microsoft.com/en-us/downloads/d2279651-851f-4d7a-bf05-16fd7eb26559/default.aspx
SET /a NumberOfErrors +=1
)
del temp1.txt temp2.txt
In the next part I will address how to find information about your system when no documentation is there.
-
Blender day 20 (actually day 10 since I had gotten 0 done in the last 10 days)
Posted on July 30th, 2011 by alfredo
Well seems life caught to me and I had to get away from blender a bit also had my parents visit for a week which was pretty awesome. I got back to it today and decided to go back an revisit the robot that I was working on last time and give it some legs.
Just so its written somewhere is you do control p to a shape while also selecting the camera you can set to follow. note you have to select the camera first the the path. Also in the object data tab the one that looks like a curve you can go to path animations and set the seconds it take to run through it.
Below a picture and a link to a video showing it. Also a screen Shot of the mesh.
MESH
-
Blender day 9 randy the robot
Posted on July 20th, 2011 by alfredo
I did not get to do anything on day 7 and 8 on day 9 I did randy the robot because of a challenge on reddit here is my render and below a photo of the mesh.
Commands Learned
shift + A for add mesh
-
Blender Day 6
Posted on July 16th, 2011 by alfredo
Today I only have like an hour to use the Blender therefore instead of finishing the tutorial will I ever I have decided to Try and put what I have learned in the past few days together therefore I revisited my first project the robot and tried to conceptualize a new one.
Thought it would be cool to make him steampunk style therefore the colors are going to be somewhat rusty and so on.
I did not manage to finish it but fairly satisfied with what I got after an hour and can feel the progress on blender actually happening.
Alfredo Out. Also on monday I will take a break from doing a blender post and go back to do a normal post on the blog(Going to talk a bit about unit testing).
A Render that I did a few minutes ago since I wanted to see if I was capable at this point. First day ever like 3 months ago when I tried blender and gave up I tried to render Eva she looked really bad so I tried again. It still meh but a lot better this one I dare show.