|
Good Day
I am building a Kinect Applications. So i am using WPF on my laptop with the resolution of
1920 * 1080
so everything looks great and last night , i wanted to test it on my Samsung HD TV 42 inch Plasma and my Buttons went missing.
So my TV resolution is 1024 x 768(NATIVE)
so i reduced my resolution to 1024 x 768 on my laptop and i experienced the same thing my TV was experiencing.
I need an Advice to adjust my apps layout to accommodate all resolutions from
1024 x 768(NATIVE) and higher resolution.
Here is an example of a Page that i have , so basically i am using navigation service i have one window that hold the frame and i make it full-screen and others are just pages.
<Page x:Class="SchoolPlay1.MainMenu"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:local="clr-namespace:Microsoft.Samples.Kinect.ControlsBasics"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:k="http://schemas.microsoft.com/kinect/2013"
xmlns:tk="clr-namespace:Microsoft.Kinect.Toolkit;assembly=Microsoft.Kinect.Toolkit"
KeepAlive="false"
Height="1008.94" Width="2086.684"
Title="MainMenu">
<Page.Background>
<ImageBrush ImageSource="/SchoolPlay1;component/Background/Background_Math.png" />
</Page.Background>
<Grid Canvas.Top="-16" x:Name="LayoutRoot" Width="1636">
<Grid Grid.Row="0" Margin="10,0,0,19.6">
<k:KinectUserViewer k:KinectRegion.KinectRegion="{Binding ElementName=kinectRegion}" Height="100" HorizontalAlignment="Center" VerticalAlignment="Top" />
</Grid>
<k:KinectRegion x:Name="kinectRegion" Margin="-226,10,-224,6.8" HorizontalAlignment="Right" Width="2086">
<Grid x:Name="kinectRegionGrid" Margin="10,20,160,19.8">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="170" />
</Grid.RowDefinitions>
<k:KinectTileButton x:Name="btnAlphabets" Canvas.Left="386" Width="Auto" Height="Auto" Canvas.Top="98" Click="btnAlphabets_Click" Background="{x:Null}" BorderBrush="{x:Null}" Margin="29,53,1521.4,153.4">
<Image Source="/SchoolPlay1;component/MainMenuImages/Final_Alphabet.png" Height="426" Width="342" />
</k:KinectTileButton>
<k:KinectTileButton x:Name="btnMath" Width="Auto" Height="Auto" Canvas.Top="98" Click="btnMath_Click" Canvas.Left="10" Background="{x:Null}" BorderBrush="{x:Null}" Margin="400,53,1137.4,153.4">
<Image Source="MainMenuImages/MathMenu.png" Height="429" Width="352" />
</k:KinectTileButton>
<k:KinectTileButton x:Name="btnFruitAndVeg" Canvas.Left="702" Canvas.Top="117" Width="Auto" Height="Auto" Click="btnFruitAndVeg_Click_1" Background="{x:Null}" BorderBrush="{x:Null}" Margin="810,109,783.4,153.4">
<Image Source="MainMenuImages/FruitAndVegMenu.png" Height="386" Width="302" />
</k:KinectTileButton>
<k:KinectTileButton x:Name="btnMiscellaneouss" Width="Auto" Height="Auto" Background="{x:Null}" BorderBrush="{x:Null}" Margin="1161,141,431.4,198.4" Click="btnMiscellaneouss_Click" IsEnabled="False" >
<Image Source="MainMenuImages/Miscellaneous_Menu.png" Height="526" Width="302" />
</k:KinectTileButton>
<k:KinectTileButton Background="{x:Null}" BorderBrush="{x:Null}" x:Name="btnBack" Click="btnBack_Click" Height="Auto" Width="Auto" Margin="-212,257,211.4,-88" Grid.RowSpan="2" >
<Image Source="NavigationButtons/Back.png" Height="200" Width="500" />
</k:KinectTileButton>
</Grid>
</k:KinectRegion>
<tk:KinectSensorChooserUI HorizontalAlignment="Center" VerticalAlignment="Top" x:Name="sensorChooserUi" Margin="461,10,538,0" />
</Grid>
</Page>
Thanks
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa[at]dotnetfunda.com
http://www.Dotnetfunda.com
|
|
|
|
|
Cheat and wrap your grid in a viewbox. It will scale everything automatically. Quick and convenient if you aren't hung up on the aspect ratio changing from system to system.
|
|
|
|
|
Thank you for your answer. it solved my problem
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa[at]dotnetfunda.com
http://www.Dotnetfunda.com
|
|
|
|
|
Our WCF and database connections are designed to handle asynchronous calls without causing a race condition. I still use chained calls to the WCF, when loading the initial static data there can be 15-20 chained calls to load the static data.
While the static data may not be critical when opening a view the sequence and completeness of the data is critical. Therefore I use chained asynch call effectively turns it into a synch process. Only when the chain is complete the view is loaded.
My question is whether it would be better to send the calls asych and each callback set a flag and tries to load the view which then checks a bunch of flags to see if the data load is completed.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I can't help but think "you're doing it wrong" if you are calling into a WCF service 15 - 20 times at start up to "load static data". Can you wrap it all into a single call? If you are using SOAP, you are sending a lot of useless crap back and forth. If you need data from calls 1,2,6 and 8 to do calls 13 - 27, you should still probably try to encapsulate it all into a single call into the WCF service to cut down on the data (speed it up). If you only have .NET clients, you can optimize it further by switching to NetTCPBinding and get rid of SOAP. If you need to support non .NET clients as well, I'd suggest REST / Json.
How much data are we talking? How often does this "static" data change? If its a lot of data and it doesn't change too frequently, I'd recommend implementing a timestamp / version scheme. Instead of calling 15 - 20 times into the service, you'd do something like "I have version 1.04 of the data. Is there a newer version?" If so, then download it and cache it locally.
|
|
|
|
|
Static data is tiny, usually less than 100 rows per table/call. We are only .net, oh wait they are looking at mobile stuff as well and json is useful there.
I have not considered changing the binding, speed is not really an issue, I keep data small and we are all inside the firewall. I had not considered passing multiple collections or complex objects as it is not supported by basic binding (I think).
I certainly would not consider the versioning, just like I don't want to deal with caching as the size and speed is not really a problem.
I think I need to look into passing multiple tables and complex objects, one of the seniors devs is in my ear about doing that so I'll drop the problem on him
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Oh. I thought speed was your issue. I believe you can pass any serializable type. If you data is loaded by the time the view comes up, whats the issue? .
|
|
|
|
|
SledgeHammer01 wrote: If you data is loaded by the time the view comes up
Well the busyindicator is in heavy use but the delay is generally 1-2 seconds even on the most complex views.
It was more of a philosophical question on design of the asynch/synch process. It seems ludicrous to have an asynch system and then chain the data calls. I think it is left over from when my DAL was single threaded and I was getting locking issues on the data reader.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Mycroft Holmes wrote: My question is whether it would be better to send the calls asych and each callback set a flag and tries to load the view which then checks a bunch of flags to see if the data load is completed.
Have each view calls its own service whenever the view is loaded.
This way, you don't do 20 calls at the same time.
|
|
|
|
|
Wat - I am talking about 1 view and a number of static tables! Of course each view has its own VM that does the calls to the WCF!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi,
I am new to SilverLight, I have created one test Application having Datagrid and Autocomplete Text box which is placed inside the datagrid,Now if the there is only one row i am able to set itemsource of the Autocomplete text box but for multiple rows how to find the control and set the itemsource?
Please help...
Thanks & Best Regards
Shwetank
modified 8-Apr-13 2:18am.
|
|
|
|
|
|
Hi,
Thanks for the reply, I have already visited the link mentioned, the thing is in that i am using WCF service to get the data from database and i have placed Autocomplete textbox Control inside the datagrid for one row i am able to find the control and add the itemsource but if there are multiple rows then how do i do that?
Thanks & Best Regards
Shwetank
|
|
|
|
|
It can be done in two ways...
if the data to be binded to AutoComplete textbox is large, bind that collection to Autocomplete box by setting the datacontext to parent element of datagrid or first control in the page(we usually use grid as the main content holder) where that datacontext holds the Autocomplete collection and bind it to AutoCompleteBox.
Here in this sample, they are binding some static resource. you can replace it with your collection and it gets binded.(Same collection gets binded to all AutoCompleteBox).
<input:AutoCompleteBox
HorizontalAlignment="Left"
Width="180"
IsTabStop="True"
Text="{Binding UserName, Mode=TwoWay}"
ItemsSource="{StaticResource SampleHeroes}"
/>
another solution is if you want different collection to be binded, you can add one more property to Users class (in this sample) which holds the collection and you can bind it directly inside AutoCompleteBox....
e.g
new Users{ UserName="Hiro Nakamura", Age=24, Gender="M", Country="Japan", AutoCompleteList = new List<string>{"Hi","Hello","Welcome","Bye" } }
But it does not seems to be good...
you can use the first approach.
|
|
|
|
|
Hi,
I tried using '' Tag but not getting....
Please find below the code i have tried...
<sdk:datagridtemplatecolumn header="Destination">
<sdk:datagridtemplatecolumn.celltemplate>
<datatemplate>
<sdk:autocompletebox height="25" name="aceDestination" verticalalignment="Top" width="175">
|
|
|
|
|
it depends on the references you are using...
you arealready using AutoCompleteBox in your app.so use the same but instead relpce its itemsource with a property name
|
|
|
|
|
Hi,
Could you please share sample code that would really help me a lot.
and one more doubt: to get the city list there is one function written in .svc class, it is returning Generic List so how to convert that to objectCollection...
Thanks & Best Regards
Shwetank
|
|
|
|
|
I have an SL 5 app that the user can drop files and directories into.
When launched from the debugger, it works as expected.
When I try to use the xap in a page on a remote site, I get a Security exception.
foreach (FileInfo fi in files)
{
// _files.Enqueue(fi);
if (fi.Attributes == FileAttributes.Directory)
Attaching the debugger to the browser, I see:
+fi.Attributes 'fi.Attributes' threw an exception of type 'System.Security.SecurityException' System.IO.FileAttributes {System.Security.SecurityException}
"File operation not permitted. Access to path '' is denied."
UPDATE: Some properties of the FileInfo object are available, but not things like Attributes, Directory, DirectoryName.
1) Why does it work when started from the debugger?
2) How can I get it working outside of the debugger?
Thanks for any insight....
modified 8-Apr-13 10:14am.
|
|
|
|
|
The OP contains the exception I see when attaching the debugger to the browser.
Certain properties of the FileInfo appear to be unavailble -- Attributes, Directory, DirectoryName -- when running outside of the browser.
|
|
|
|
|
As Colin mentioned (sort of ), this is Silverlight. It runs in a locked down sandbox environment and does not have access to local resources (files, registry, etc.). If you want to have access to those types of things, you need to specify that you want elevated permisions in your config file.
|
|
|
|
|
Thanks for the reply.
A hint on how to specify the elevated permissions would be appreciated...
(Weird: when I build and run the project -- from the debugger -- on a different computer, the app does not have elevated permission. Trying to figure out the difference between the two computers.
I have this code in a handler for the MainPage Loaded event:
Msgs.Text = string.Format("{0} ElevatedPermissions", (Application.Current.HasElevatedPermissions ? "Has" : "Does NOT have"));
)
|
|
|
|
|
My google foo is failing.
I have a treeview with a HierarchicalDataTemplate made up of a user control, in the UC I have a textbox where acceptreturn=true. When the user presses enter while editing the textbox the treeview grabs the enter key event.
How can I force the enter key press event down to the textbox?
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Idiot - e.handled = false on the keydown event
private void EnterDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Enter)
{
e.Handled = false;
}
}
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
The enter key only passes to the UC when there are no child nodes
Using the Telerik grid so I will go annoy them b/c I think it is control specific!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
The tree view is kinda weird in that some messages get funneled up the parent nodes until it reaches the root. Some other messages are eaten by the parent nodes. Have you tried using the preview events? You can usually get those consistently... except when you can't.
|
|
|
|