[SDK] XFControls - Advanced UI SDK [UPDATED w/ Sense UI Example!]

Search This thread

JarekG

Senior Member
Feb 16, 2008
135
10
Hi,
What I'm trying to do is read XML file from internet. One of the information is a image, those will change every 3-5 minutes.
The layout would be to have picture on the left (read from internet so it can be as a stream, since the images will change every 3-5 minutes or I can save them and load them from file) on the right of the image I need 2 lines of text. They are not long but wordwrap would be helpfull.
This is what I have currently and I like to keep this format.
What I want to remove is the combobox on top and replace with Listview with children...once you click on the child it will take you there and show the 3 sections.
 

Attachments

  • Image.png
    Image.png
    83.9 KB · Views: 185
Last edited:

joe_coolish

Retired Recognized Developer
Mar 26, 2010
755
234
American Fork
Ok, in the zip there is a fresh copy of the DLLs and a .cs file that contains the code for your item.

I'm sorry I wasn't able to comment out things for you :( I was in a rush! If you have any questions let me know :)

If you want to change any of the styling, check the CTOR. The Style object contains all of the information about changing the style.

To use the object: MainText is the main text, SecondaryText is the secondary text :p ImageUri is a string to the images URI (either local or web works)

I hope that works for you! If not, let me know and I'll change it :)
 

Attachments

  • XFItemXMLView.zip
    104.2 KB · Views: 68

JarekG

Senior Member
Feb 16, 2008
135
10
I'm not sure if I'm doing something wrong but the new DLL's I don't see SenseItemSlide()
There is SenseItemSlider but it does not have "RightPanel" and I can't see "SecondaryText".
 

joe_coolish

Retired Recognized Developer
Mar 26, 2010
755
234
American Fork
I'm not sure if I'm doing something wrong but the new DLL's I don't see SenseItemSlide()
There is SenseItemSlider but it does not have "RightPanel" and I can't see "SecondaryText".

Oh, yes. Sorry I renamed that item :eek: It is now called SenseItemMoreItems.

I hope everything works out! Sorry for the change. I was just getting confused with the Slide and the Slider so one of their names had to go :p
 

JarekG

Senior Member
Feb 16, 2008
135
10
That worked. But I can't figure out how to add the XFItemXMLView now to the Subitem.
Could you mabe draw small code?
Also could it be possible to add Tag property to store hidden info (in my case I need the URL of station to play....there are 75 of them so I need to know what to play ).
 
Last edited:

joe_coolish

Retired Recognized Developer
Mar 26, 2010
755
234
American Fork
That worked. But I can't figure out how to add the XFItemXMLView now to the Subitem.
Could you mabe draw small code?
Also could it be possible to add Tag property to store hidden info (in my case I need the URL of station to play....there are 75 of them so I need to know what to play ).

Yes, you can just add a string member variable into the XMLView item.

As for adding it an XFPanelList, just create an object then pass it into the "Add()" method. I don't have much time today or tomorrow but saturday I can write something up for you if you haven't figured it out by then :)

Good luck!
Joel
 

JarekG

Senior Member
Feb 16, 2008
135
10
I fugure out how to add this, one problem that I'm having is to load the images.
When I pass image location, the image is not loading.
This line of code always has 0 for all options:
_imgRec = this.GetImageRec(ImageUri);

It looks like the GetImageRec can't return the actual size of the image...not sure why..I try different ways. The only way I didn't try is to load from resources.
 
G

GuestK00306

Guest
Looks great, one quick question: Is this SDK based on this code like the rest of them, or is it all your own work?
http://xdaforums.com/showthread.php?t=333124

Because that code has a LOT of issues on some devices and I have yet to find a nice WinMo SDK which isn't based off it...
 

joe_coolish

Retired Recognized Developer
Mar 26, 2010
755
234
American Fork
Looks great, one quick question: Is this SDK based on this code like the rest of them, or is it all your own work?
http://xdaforums.com/showthread.php?t=333124

Because that code has a LOT of issues on some devices and I have yet to find a nice WinMo SDK which isn't based off it...

The code is my original work, but I did get ideas for implementation from various places on the internet (mainly math and physics sites believe it or not). I haven't seen the scrolling panel from the link you provided and I haven't downloaded the code to see what it does. The process might be similar, but I did not base my code off of it.

Feel free to browse the code and see if it works for your target devices. So far I haven't found a (touch screen) device on which the SDK doesn't work.

I'm also available to answer any questions for you :)

Let me know what you think!

The link to the source is in the 3rd post, or right here
http://code.google.com/p/xda-winmo-facebook/source/browse/
 

joe_coolish

Retired Recognized Developer
Mar 26, 2010
755
234
American Fork
I fugure out how to add this, one problem that I'm having is to load the images.
When I pass image location, the image is not loading.
This line of code always has 0 for all options:
_imgRec = this.GetImageRec(ImageUri);

It looks like the GetImageRec can't return the actual size of the image...not sure why..I try different ways. The only way I didn't try is to load from resources.

Sorry it has taken me this long to reply.

The GetImageRec takes the ImageUri and does the following:
  • Takes the calling object and gets its assembly information
  • appends .Resources.<ImageUri value> to the retrieved assembly's namespace
  • calls myAssembly.GetManifestResourceStream(<string from process above>) and gets that image's rectangle

So, check the calling object's NameSpace and see if there is a Resources folder at the first level, then check to see if that URI is in that folder.

Alternatively, you could output the image to the local device in a folder called Resources that is located in the same directory as the executable

let me know if there is anything else i can help you with
 
G

GuestK00306

Guest
The code is my original work, but I did get ideas for implementation from various places on the internet (mainly math and physics sites believe it or not). I haven't seen the scrolling panel from the link you provided and I haven't downloaded the code to see what it does. The process might be similar, but I did not base my code off of it.

Feel free to browse the code and see if it works for your target devices. So far I haven't found a (touch screen) device on which the SDK doesn't work.

I'm also available to answer any questions for you :)

Let me know what you think!

The link to the source is in the 3rd post, or right here
http://code.google.com/p/xda-winmo-facebook/source/browse/

Nice work! Had a glance through the source. Looks very neat. I'm not very good with bitmap memory management in .NET CF - but I think you should be disposing of the background Bitmaps in the XFPanelBase literally as soon as you're done with them? Maybe not.

This looks like a great base SDK. I don't have the time to rewrite the basic stuff (e.g. A text input control) but I'm sure someone will create some great controls from this.
 

joe_coolish

Retired Recognized Developer
Mar 26, 2010
755
234
American Fork
Nice work! Had a glance through the source. Looks very neat. I'm not very good with bitmap memory management in .NET CF - but I think you should be disposing of the background Bitmaps in the XFPanelBase literally as soon as you're done with them? Maybe not.

This looks like a great base SDK. I don't have the time to rewrite the basic stuff (e.g. A text input control) but I'm sure someone will create some great controls from this.

Thank you!

The reason I don't dispose of the background bitmaps is because I use them as a cache. They get disposed when the panel is disposed, but while the panel is actively used, the background bitmaps are constantly in use.

This is because the double buffer is the fastest refresh technique on our phones and if you are constantly creating and disposing the bitmap, that creates more overhead than just keeping it in memory and manipulating the bitmap.

The bitmaps are also cached in the IXFItem. This is because the cost in time to render the image in the first place is pretty expensive. but rendering the cached image is super cheap. this allows for the really smooth scrolling and animation effects.
 

meltwater

Inactive Recognized Developer
Jan 28, 2009
2,070
325
Thank you!

The reason I don't dispose of the background bitmaps is because I use them as a cache. They get disposed when the panel is disposed, but while the panel is actively used, the background bitmaps are constantly in use.

This is because the double buffer is the fastest refresh technique on our phones and if you are constantly creating and disposing the bitmap, that creates more overhead than just keeping it in memory and manipulating the bitmap.

The bitmaps are also cached in the IXFItem. This is because the cost in time to render the image in the first place is pretty expensive. but rendering the cached image is super cheap. this allows for the really smooth scrolling and animation effects.

Can I just download your .net knowledge instead of the code! ;)

There is such a steep learning curve when you have to step off the standard control path (which with compact framework, is quite often). Fingers crossed they've done a better job with Silverlight.

Will have a test of it today.
 

JarekG

Senior Member
Feb 16, 2008
135
10
Sorry it has taken me this long to reply.

The GetImageRec takes the ImageUri and does the following:
  • Takes the calling object and gets its assembly information
  • appends .Resources.<ImageUri value> to the retrieved assembly's namespace
  • calls myAssembly.GetManifestResourceStream(<string from process above>) and gets that image's rectangle

So, check the calling object's NameSpace and see if there is a Resources folder at the first level, then check to see if that URI is in that folder.

Alternatively, you could output the image to the local device in a folder called Resources that is located in the same directory as the executable

let me know if there is anything else i can help you with

I don't think that will work. Correct me if I'm wrong but if I save the files to Resources folder they also have to be set as Embedded Resource in order for the GetManifestResourceStream to get them. But if I save them on the fly, they will only be set as Content.
 

joe_coolish

Retired Recognized Developer
Mar 26, 2010
755
234
American Fork
I don't think that will work. Correct me if I'm wrong but if I save the files to Resources folder they also have to be set as Embedded Resource in order for the GetManifestResourceStream to get them. But if I save them on the fly, they will only be set as Content.

Whoa, I totally didn't see this comment! I should be more on top of things :)

If you save it directly to a folder called "Resources" then it can be loaded on the fly. Also, you can take a look at how I implemented Icons for my XDAFacebook App to see how I'm handling images downloaded from the internet.

Either way, you can load the images how ever you want and just render them in the ItemDraw() method of the IXFItem. If the image is added after the initial loading of the image, you need to clear the buffer for it to be drawn. This is accomplished by doing the following:

if(Buffer != null)
Buffer.Dispose();
Buffer = null;

That way the next time the item is drawn, the buffer is redrawn as well.

I am implementing it into my application as soon I research on this.

Sweet! Glad to help in any way I can :)
 

tilleke

Retired Recognized Developer
May 9, 2008
612
67
Thanks for sharing Joe,

this SDK could indeed get handy in the future for a project I have.
 

needle2k

Senior Member
Feb 22, 2009
76
6
Hi,

is there a way to add an own Icon to SenseItem / SenseMoreItems infront of text and center the text ?
since i only get them from Resource, also how can i add transparency to
XFPanelContainer() -> show form backgroundImage , i´m new to c# so a lttle help would be appreciated


thx

needle
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 3
    This is an Advanced UI SDK for developing finger-friendly Application UIs.

    The reason for developing this SDK was mainly to learn about programming for Windows Mobile and the Compact Framework 3.5. I also developed this SDK because I could not find good UI controls that gave total display control to the programmer while taking care of all of the Physics, windowing, and frame buffering AND was open source.

    Finally, this SDK was originally developed as part of the XDAFacebook application that I am currently developing.

    I am releasing this SDK and its source so that people can have a good foundation to build finger-friendly Windows Mobile applications, and so that programmers starting off in the Windows Mobile world won't have to start from scratch when creating useful UI Controls.

    Here are some of the features and uses of this SDK.

    Features:
    • Fully customizable
    • Easily create custom UI Controls
    • Resolution independent
    • Full physics for rendering smooth scrolling

    Uses:
    • Quickly create UI controls
    • Develop full UI SDKs
    • Learn basic UI programming for .net CF 3.5

    I ask that if you use these controls, please provide feedback so that everyone can benefit!


    Thank you and I hope you find these controls useful!
    1
    Thanks for sharing Joe,

    this SDK could indeed get handy in the future for a project I have.

    Sweet! The SDK in this thread is pretty old. PM me for a newer one if you'd like!