RE: Control thumbnails

2010-12-06 Thread Greg Keogh
I have found that it is unreliable to use a Viewbox unless you specifically
want the effects it produces.

I planned to fill the parent Grid with a Viewbox Stretch=None to effectively
turn it off, but there are weird side-effects. Viewbox has a mind of its own
about sizing inside a parent. I cannot get a Viewbox to reliably fill a
parent Grid.

I will therefore have to dynamically rearrange the child controls to place
them inside Viewbox inside different Grid cells to get my tiled effect.

This is possible, but it's a lot of loops and code and jugging controls
around to different parents. I'll think about it...

Greg

___
ozsilverlight mailing list
ozsilverlight@ozsilverlight.com
http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight


Re: Control thumbnails

2010-12-06 Thread Miguel Madero
+1 hehehe

On Mon, Dec 6, 2010 at 10:43 PM, Shane Morris (Automatic Studio) <
sh...@automaticstudio.com.au> wrote:

> Hey, one more crack like that about Blend and I'll withdraw all
> suggestions!
>
> :-)
>
> -Original Message-
> From: ozsilverlight-boun...@ozsilverlight.com [mailto:
> ozsilverlight-boun...@ozsilverlight.com] On Behalf Of Greg Keogh
> Sent: Monday, 6 December 2010 10:32 PM
> To: 'ozSilverlight'
> Subject: RE: Control thumbnails
>
> Shane is a mind-reader. I was looking for the control that auto-sizes its
> contents in various ways, it's the ViewBox of course.
>
> I'll wrap each child in a ViewBox. My parent  can have 4 x 4 cells,
> and in normal display the top visible control will have row and col span 4
> with Stretch=None.
>
> In tiled mode I'll show all children in a specific cell with
> Stretch=Uniform.
>
> Half an hour later: My experiments show it's starting to work, but there
> are some strange sizing behaviours like the Viewbox isn't filling the Grid.
> I'll look at it in the morning with a fresh mind.
>
> ADDENDUM: Jack, I received your message just before sending. 'Fluid Layout'
> is something I'd forgotten about completely. I'd rather go to the dentist
> than use Blend, but I'll try to figure out what it's doing behind the scenes
> and see if I can steal the code for a snazzy transition.
>
> Cheers,
> Greg
>
> ___
> ozsilverlight mailing list
> ozsilverlight@ozsilverlight.com
> http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight
> ___
> ozsilverlight mailing list
> ozsilverlight@ozsilverlight.com
> http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight
>



-- 
Miguel A. Madero Reyes
www.miguelmadero.com (blog)
m...@miguelmadero.com
___
ozsilverlight mailing list
ozsilverlight@ozsilverlight.com
http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight


RE: Control thumbnails

2010-12-06 Thread Shane Morris (Automatic Studio)
Hey, one more crack like that about Blend and I'll withdraw all suggestions!

:-)

-Original Message-
From: ozsilverlight-boun...@ozsilverlight.com 
[mailto:ozsilverlight-boun...@ozsilverlight.com] On Behalf Of Greg Keogh
Sent: Monday, 6 December 2010 10:32 PM
To: 'ozSilverlight'
Subject: RE: Control thumbnails

Shane is a mind-reader. I was looking for the control that auto-sizes its 
contents in various ways, it's the ViewBox of course.

I'll wrap each child in a ViewBox. My parent  can have 4 x 4 cells, and 
in normal display the top visible control will have row and col span 4 with 
Stretch=None.

In tiled mode I'll show all children in a specific cell with Stretch=Uniform.

Half an hour later: My experiments show it's starting to work, but there are 
some strange sizing behaviours like the Viewbox isn't filling the Grid. I'll 
look at it in the morning with a fresh mind.

ADDENDUM: Jack, I received your message just before sending. 'Fluid Layout'
is something I'd forgotten about completely. I'd rather go to the dentist than 
use Blend, but I'll try to figure out what it's doing behind the scenes and see 
if I can steal the code for a snazzy transition.

Cheers,
Greg

___
ozsilverlight mailing list
ozsilverlight@ozsilverlight.com
http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight
___
ozsilverlight mailing list
ozsilverlight@ozsilverlight.com
http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight


RE: Control thumbnails

2010-12-06 Thread Greg Keogh
Shane is a mind-reader. I was looking for the control that auto-sizes its
contents in various ways, it's the ViewBox of course.

I'll wrap each child in a ViewBox. My parent  can have 4 x 4 cells,
and in normal display the top visible control will have row and col span 4
with Stretch=None.

In tiled mode I'll show all children in a specific cell with
Stretch=Uniform.

Half an hour later: My experiments show it's starting to work, but there are
some strange sizing behaviours like the Viewbox isn't filling the Grid. I'll
look at it in the morning with a fresh mind.

ADDENDUM: Jack, I received your message just before sending. 'Fluid Layout'
is something I'd forgotten about completely. I'd rather go to the dentist
than use Blend, but I'll try to figure out what it's doing behind the scenes
and see if I can steal the code for a snazzy transition.

Cheers,
Greg

___
ozsilverlight mailing list
ozsilverlight@ozsilverlight.com
http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight


Re: Control thumbnails

2010-12-06 Thread Jack Ukleja
How about using the FluidLayout behavior from Blend?
http://msdn.microsoft.com/en-us/library/ee341455(Expression.30).aspx

First setup the Grid with the 4x4 rows/cols.

Then
create two visual states:

The first state will be your Grid with the child items arranged (by the
sounds of it) in some sort of "stacking" layout.

The second state will be your Grid with the child items arranged, with each
item in one of the 16 grid cells.

Then when you switch Visual State the layout will change.

Activate the FluidLayout by clicking the little wave icon in the States
window, and set the default transition to 1sec - if previews are enabled, as
you toggle between visual states you should get smooth animated transitions.

Note: If you are literally adding/removing items from the panel you will
need to make sure that the items defined in the visual state are permanent
i.e. you may need to place each "child control" into a container such that
it is always present in the Grid. Do you already animate the push?

Cheers,
Jack

On Mon, Dec 6, 2010 at 4:43 PM, Greg Keogh  wrote:

> This question is related to Silverlight and WPF, as I may need to use this
> technique in both sorts of apps.
>
>
>
> My app’s main  parent control can contain different types of child
> controls that display data in various ways. I internally maintain a 16-deep
> List<> of the children, I push a new child onto the top and make it visible,
> the others are pushed down and hidden and the oldest one drops off the end
> when it’s full. So I effectively have an MRU list of up to 16 child controls
> available.
>
>
>
> When the user hits a hotkey I want make all of the children visible and
> tile them in a nice 4 x 4 arrangement as thumbnails.
>
>
>
> I’m just not sure what the best mechanism is to achieve this. At first I
> thought I’d do it manually: centre-position and scale transform each child
> to create a fake tiled arrangement and maintain it on size changes.
>
>
>
> Before I do this manual coding, I thought I’d ask for ideas about better
> techniques.
>
>
>
> Cheers,
>
> Greg
>
> ___
> ozsilverlight mailing list
> ozsilverlight@ozsilverlight.com
> http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight
>
>
___
ozsilverlight mailing list
ozsilverlight@ozsilverlight.com
http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight


RE: Control thumbnails

2010-12-05 Thread Shane Morris (Automatic Studio)
A processor-intensive way might be to set up your grid with 4 equally spaced 
rows and columns (each Size: 1*). Wrap each control in viewbox, then when the 
user hits the key, place each control (viewbox) in a table cell, sized to fit 
the cell. 

Downsides:
- processor intensive
- The controls are still 'active' - might not be what you want
- Scaling down a control to 1/16 its original size is likely to result in a 
squashed-bug-like appearance if you don't strip out detail

Shanemo


-Original Message-
From: ozsilverlight-boun...@ozsilverlight.com 
[mailto:ozsilverlight-boun...@ozsilverlight.com] On Behalf Of Stephen Price
Sent: Monday, 6 December 2010 4:55 PM
To: ozSilverlight
Subject: Re: Control thumbnails

You could look at the wrappanel in the Silverlight toolkit. That would handle 
your wrapping in a 4 x 4 grid (if you limit the width).

If you want to get fancy you could write your own custom control, basing it on 
a Panel. That way you can have full control over how your panel displays its 
content. Thats assuming the wrap panel doesn't already do what you want. Also 
not sure if WPF has an equivalent. I'd assume so but if not you could get the 
source from the SL version/toolkit.

cheers,
Stephen

On Mon, Dec 6, 2010 at 1:43 PM, Greg Keogh  wrote:
> This question is related to Silverlight and WPF, as I may need to use 
> this technique in both sorts of apps.
>
>
>
> My app's main  parent control can contain different types of 
> child controls that display data in various ways. I internally 
> maintain a 16-deep List<> of the children, I push a new child onto the 
> top and make it visible, the others are pushed down and hidden and the 
> oldest one drops off the end when it's full. So I effectively have an 
> MRU list of up to 16 child controls available.
>
>
>
> When the user hits a hotkey I want make all of the children visible 
> and tile them in a nice 4 x 4 arrangement as thumbnails.
>
>
>
> I'm just not sure what the best mechanism is to achieve this. At first 
> I thought I'd do it manually: centre-position and scale transform each 
> child to create a fake tiled arrangement and maintain it on size changes.
>
>
>
> Before I do this manual coding, I thought I'd ask for ideas about 
> better techniques.
>
>
>
> Cheers,
>
> Greg
>
> ___
> ozsilverlight mailing list
> ozsilverlight@ozsilverlight.com
> http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight
>
>
___
ozsilverlight mailing list
ozsilverlight@ozsilverlight.com
http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight
___
ozsilverlight mailing list
ozsilverlight@ozsilverlight.com
http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight


Re: Control thumbnails

2010-12-05 Thread Stephen Price
You could look at the wrappanel in the Silverlight toolkit. That would
handle your wrapping in a 4 x 4 grid (if you limit the width).

If you want to get fancy you could write your own custom control,
basing it on a Panel. That way you can have full control over how your
panel displays its content. Thats assuming the wrap panel doesn't
already do what you want. Also not sure if WPF has an equivalent. I'd
assume so but if not you could get the source from the SL
version/toolkit.

cheers,
Stephen

On Mon, Dec 6, 2010 at 1:43 PM, Greg Keogh  wrote:
> This question is related to Silverlight and WPF, as I may need to use this
> technique in both sorts of apps.
>
>
>
> My app’s main  parent control can contain different types of child
> controls that display data in various ways. I internally maintain a 16-deep
> List<> of the children, I push a new child onto the top and make it visible,
> the others are pushed down and hidden and the oldest one drops off the end
> when it’s full. So I effectively have an MRU list of up to 16 child controls
> available.
>
>
>
> When the user hits a hotkey I want make all of the children visible and tile
> them in a nice 4 x 4 arrangement as thumbnails.
>
>
>
> I’m just not sure what the best mechanism is to achieve this. At first I
> thought I’d do it manually: centre-position and scale transform each child
> to create a fake tiled arrangement and maintain it on size changes.
>
>
>
> Before I do this manual coding, I thought I’d ask for ideas about better
> techniques.
>
>
>
> Cheers,
>
> Greg
>
> ___
> ozsilverlight mailing list
> ozsilverlight@ozsilverlight.com
> http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight
>
>
___
ozsilverlight mailing list
ozsilverlight@ozsilverlight.com
http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight


Re: Control thumbnails

2010-12-05 Thread Joseph Cooney
I'm not sure what you're asking - how to achieve the 4x4 grid (I'd use
uniformgrid in WPF...I don't think SL has this) or how to display a
thumbnail of an arbitrary control? (I'd use VisualBrush or
RenderTargetBitmap in WPF - SL has VisualBrush)

Joseph

On Mon, Dec 6, 2010 at 3:43 PM, Greg Keogh  wrote:

> This question is related to Silverlight and WPF, as I may need to use this
> technique in both sorts of apps.
>
>
>
> My app’s main  parent control can contain different types of child
> controls that display data in various ways. I internally maintain a 16-deep
> List<> of the children, I push a new child onto the top and make it visible,
> the others are pushed down and hidden and the oldest one drops off the end
> when it’s full. So I effectively have an MRU list of up to 16 child controls
> available.
>
>
>
> When the user hits a hotkey I want make all of the children visible and
> tile them in a nice 4 x 4 arrangement as thumbnails.
>
>
>
> I’m just not sure what the best mechanism is to achieve this. At first I
> thought I’d do it manually: centre-position and scale transform each child
> to create a fake tiled arrangement and maintain it on size changes.
>
>
>
> Before I do this manual coding, I thought I’d ask for ideas about better
> techniques.
>
>
>
> Cheers,
>
> Greg
>
> ___
> ozsilverlight mailing list
> ozsilverlight@ozsilverlight.com
> http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight
>
>
___
ozsilverlight mailing list
ozsilverlight@ozsilverlight.com
http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight


Control thumbnails

2010-12-05 Thread Greg Keogh
This question is related to Silverlight and WPF, as I may need to use this
technique in both sorts of apps.

 

My app's main  parent control can contain different types of child
controls that display data in various ways. I internally maintain a 16-deep
List<> of the children, I push a new child onto the top and make it visible,
the others are pushed down and hidden and the oldest one drops off the end
when it's full. So I effectively have an MRU list of up to 16 child controls
available.

 

When the user hits a hotkey I want make all of the children visible and tile
them in a nice 4 x 4 arrangement as thumbnails.

 

I'm just not sure what the best mechanism is to achieve this. At first I
thought I'd do it manually: centre-position and scale transform each child
to create a fake tiled arrangement and maintain it on size changes.

 

Before I do this manual coding, I thought I'd ask for ideas about better
techniques.

 

Cheers,

Greg

___
ozsilverlight mailing list
ozsilverlight@ozsilverlight.com
http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight