How would you create stackable rectangles in Xamarin C# for iOS? - c#

I have a UIView that I want to fill with multiple rectangles stacked on top of each other horizontally at 100% width. They all need to have their own name and need to work for any iOS device regardless of size.
Here's a simple diagram showing what I would like to accomplish:

With Xamarin.Forms, this is achieved by using a StackLayout.
http://iosapi.xamarin.com/?link=T%3aXamarin.Forms.StackLayout

I find it difficult to control the exact sizes of StackLayouts if you're not sure of the size of your content.
If i need something to stay fixed size, i use Grids:
http://iosapi.xamarin.com/?link=T%3aXamarin.Forms.Grid

I would recommend XibFree for this:
http://www.toptensoftware.com/xibfree/
They have a few great examples which covers these case as well:
http://www.toptensoftware.com/xibfree/example_2
http://www.toptensoftware.com/xibfree/example_1
If you would need any more help with XibFree feel free to ask anything in comment :)

Related

C# WPF: Complex Shape objects on a Canvas? MVVM

This is more of a "Is it possible (with a reasonable amount of time and work)" than a "how exactly is it possible" question. I'm getting into WPF at the moment and am interested in graphical applications in an MVVM approach. In the meaning of an ms-paint like application. Now I see that and how I can draw e.g. a ractangle on a canvas, store those rectangles in a list etc.
But I am wondering if I can do that more advanced. For example extend the rectangle so I can give it more infos (I can't extend the rectangle itself since it's a sealed class), have existing shapes on the canvas able to drag them around, make the shapes complex (e.g. I double click one to open a new Window that represents the "inside" of that shape) etc.
Is such an application possible with a reasonable amount of work and time in WPF or would I rather use some different library/framework for this?
Yes, It is possible, Actually, you are listing CAD specifications, In fact, I work on this type of technology, so I'll suggest you some resources to have a clue..
Take a look at this project(WPF, 2D)
And this one(WPF, 3D)
And this one(WPF, 2D)
The previous projects are WPF-based, also, you might host a WinForm control in your WPF app, take a look at this one(WinForms, 2D)
If you change the specification a bit and say: "I don't want to edit the drawings on the canvas", then you could go with this option: convert your shapes to PathFigureCollection and EllipseGeometry objects, then construct Paths from these objects and add the Paths to the Canvas, this is a pure WPF approach. Indeed, you can add traditinal controls like TextBlocks as children to your Canvas, I have done such one like this..
Hope it helps.

Dynamic grid-ish Flow-Layout using LayoutGroupControl and GroupControl

I am about to write a main menu for a Windows Forms application.
Rather than trying to explain my goal with a wall of text i made a quick(ugly) paint sketch:
As you can see here i want the Group Controls to automatically scale with their content(similar to the wrap_content attribute in android) and fit underneath each other if possible.
If anyone knows how to achieve this or even has a sample where he already did achieve it, that would help me massively!
thanks, Felix.

how can I lock shapes in PowerPoint?

I'm working on a Add-in for PowerPoint 2010 (C#) and I want to prevent the end-user to move or edit all the shapes that I have programmatically created.
I have already sought in the framework but I think it's not allowed programmaticaly. Has anyone already encountered this kind of limitations and could help me to find a solution?
I know that some people create their add-in thanks to C++ because there are a lot of limitations in office.
I have found two solutions :
The first is to catch all events from the "commandBars.OnUpdate" like this great sample code : http://code.msdn.microsoft.com/CSExcelNewEventForShapes-0e26b1f2#content
Then you can impose the position/the color or everything you want to your shape.
The second one is more "brutal" > unselect immediately the shape. When you catch all the events from the "CommandBars.OnUpdate" do this :
To see which shape is selected :
var selectedShape = this.Application.ActiveWindow.Selection.ShapeRange[1]
In all my shapes, I have set a tag with an ID. I have just to check that there are an ID in the tags of the selectedShape and if this is the case :
this.Application.ActiveWindow.Selection.Unselect();
Then I show a messageBox to warn the user to do not select this kind of shape.
I don't like this solution but it's the only one that I have found and it works.
I believe this is not possible. A way of achieving this to a certain extent (people can work around it if they figure out how to select the shapes below) is by making a transparent rectangle the size of the canvas and binding a custom event to that (like you described in your comment). The transparent rectangle is overlaying the shapes you created so people can no longer access the shapes that way. Of course if they are capable of figuring out how to select the shapes they can move them anyway...
Alternatively, to make people not do stuff like that (you only stop the inexperienced) you can also set them up as master slides.
Only 'real' solution for people not doing that? Images .. but then they can move the image too!

How to hide "cracks" between GeometryModel3Ds in one ModelVisual3D?

I am writing a geoscience visualization application that uses wpf 3d. The user needs to be able to zoom deep into detail and out quick with minimum resources taken. I've decided to divide my slice (ModelVisual3D) into subrectangles (GeometryModel3D), so that each has it's own texture that changes when the camera zooms in (similar to Google maps).
The problem is that "cracks" are appearing between subrectangles, even though they actually have no empty space between them.
How to hide these? or is there any other way to assign multiple materials with different sizes to one ModelVisual3D?
PS I've tried making the background gray, light-gray, silver and white-smoke. It helps a little, but it's not acceptable. I've also tried overlapping the subrectangles, with no result.
Instead of your current setup you might want to make several textures at different resolutions and switch between these depending on the zoom level. (Mipmaps)
When getting really close you might replace the entire object and switch it for a much smaller one) and use a highly detailed texture.
It will require a bit more pre-processing but you will be able to use a single geometry.
Seems like changing ImageBrush's stretch to Stretch.None and using textures larger than the subsquare helps. Although now I need more precise control over texture coordinates for the surface.

how to work with and draw resize images WPF C#

Hello I need to know how I can manage to resize and draw pictures in a given space and the top and left values ​​are stored in a database or XML. What elements need to use?
I put pictures of the software that works to perfection, really need to create something like what is shown in the following images:
Imagen 2
Imagen 3
Thanks!!
You probably want a canvas with a resizing adorner that tells the elements what size and placement to draw. Here is one such example.

Categories

Resources