|
hello guys... I am having difficult time and am unable to find the panel control (in Silverlight) inwhich we can group some of the controls (like labels, textboxes and buttons) and then name that group in top left corner of that panel. How to get/add/find that control and add on the silverlight app? thnx
|
|
|
|
|
u can use stackpanel for this... and for groupbox a free dll is available in codeplex u can google it n use it...
|
|
|
|
|
Have u tried System.Windows.Controls.GroupBox?
Just right-click anywhere in your tool box and then "select items" (or is it "select elements" I'm using the german version of VS2010) and type groupbox in the filter text box. Then select "GroupBox", click ok and you'll find it in the tool box. (The icon shows a small box labeled "XY")
|
|
|
|
|
Hello All,
I have strange problem. I have used WCF services in my Silverlight applications. Sometimes, WCF service called twice.
I have set following properties for the BasicHttpBinding.
-- binding.MaxBufferSize = Int32.MaxValue;
-- binding.MaxReceivedMessageSize = Int32.MaxValue;
For overcoming such type of situations, I have unregistered the WCF method call and its working fine. Is it proper solutions for that?
It would be gr8 if anyone can explain me, why such type of issue happens.
|
|
|
|
|
It will surely help who? You've just posted this as a random top-level message in this forum.
|
|
|
|
|
I think you posted this answer in the wrong place.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
|
|
|
|
|
You got Reported!!
// ♫ 99 little bugs in the code,
// 99 bugs in the code
// We fix a bug, compile it again
// 101 little bugs in the code ♫
|
|
|
|
|
|
[EDIT] My bad, it was date against int, solved!
I have a scatter view with point and the axis are date against date (I know, weird, but work out quite well, i.e. very meaningful user experience).
At any rate I have trouble with the Y axis setup.
Here is my current XAML:
<chart:Chart TitleStyle="{StaticResource NoTitle}">
<chart:Chart.Axes>
<chart:DateTimeAxis
Orientation="X"
IntervalType="Months"
AxisLabelStyle="{StaticResource maxis}"
Minimum="2000/07/01"
Maximum="2001/06/30"
/>
<chart:DateTimeAxis
Orientation="Y"
IntervalType="Years"
>
</chart:DateTimeAxis>
</chart:Chart.Axes>
<chart:ScatterSeries
Title="{Binding ScatterTitle, ElementName=root}"
ItemsSource="{Binding GraphData, ElementName=root}"
IndependentValuePath="Date"
DependentValuePath="Value"
DataPointStyle="{StaticResource spoint}"
/>
</chart:Chart>
This kind of work except... I have 2 Y-Axis! One of the left with just the year, as I'd like.
And one on the right with regularly spaces dates (not falling on year start), I don't want it! Anything as a Y value of "xxxx january 1"
how could I get rid of it?
why visit even there?!
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
modified on Thursday, June 16, 2011 9:00 PM
|
|
|
|
|
Hello,
Is there a simple mean in WPF to make one control overlay on top of another?
- Do you have to programmatically take a way with Adorner?
- Is this not standard?
My case is I have a UserControl named 'MenuControl', to show above another UserControl named 'ViewControl', inside a Window.
<br />
<Window ...><br />
<Grid><br />
<cc:ViewControl x:Name="viewControl" Margin="3,3,3,3" Width="Auto" Height="Auto" /><br />
<my1:MenuControl x:Name="menuControl1" HorizontalAlignment="Right" VerticalAlignment="Center" xmlns:my1="clr-namespace:Application.Controls" /><br />
</Grid><br />
</Window><br />
I am using: .NET Framework 3.5, VS 2008.
|
|
|
|
|
It is standard. Grid children will overlap each other if they are positioned that way. Your issue is that MenuControl is set to H Right / V Center, but ViewControl has something different entirely. They will overlap if the window is small enough and the controls are large enough, but if you truely want them to overlap, they needed to be positioned the same way.
|
|
|
|
|
Thanks in advance ,
I had downloaded Microsoft Expression 4 trial version, but unfortunately could not use it , i am new to silver light stuff etc, and had not used Mic. Expression before so basically was exploring but used only two to three times because of other projects burden and it has expired
My Question is, Is there any way to increase trial period even i re installed , but its still showing that i have to enter the key. i hope so its not piracy
SOFTDEV
Luck in life always exists in the form of an abstract class that cannot be instantiated directly and needs to be inherited by hard work and dedication.
|
|
|
|
|
Bypassing the limit on such a trial product would be piracy. If you do this make sure you pay your lawyers more than Microsoft pay theirs.
The best things in life are not things.
|
|
|
|
|
No there isnt. Not any legal way.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
|
|
|
|
|
Working on our Silverlight Application. (1 year old, yoohoo! ) everything runs fine, yoohoo!
And then, I press F5 and... I got a blank page with a big sign:
"To view this content, please install: Microsoft Silverlight"
Err... but it's already there with higher version than the minimum required... It already worked for hundreds of hour!
What's going on?!?
I tried again (you know, F5, Debug!) and this time it worked!
Very strange...
I'd like to get to the bottom of that as some customer had similar problem (except, for them, the nagging install screen didn't go away...)
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
I'm using the WPF DataGrid that comes with .net 4.0.
The DataGrid's ItemsSource is bound to an ObservableCollection of ViewModels - one ViewModel for each Row. The count of rows is constant at any time. Depending on a Property in a row's viewmodel, the row has to be visible or collapsed. I do not want to manipulate the underlying itemssource because I want to keep the data in the viewmodels. I just want to set the Visibility of the rows.
So I created a style and set the DataGrid's "RowStyle" Property to it:
<Style x:Key="MyRowStyle" TargetType="{x:Type DataGridRow}">
<Style.Triggers>
<DataTrigger Binding="{Binding PropertyFromViewModel}" Value="False">
<Setter Property="Visibility" Value="Collapsed" />
</DataTrigger>
</Style.Triggers>
</Style>
This actually works, but the datagrid scrollbar's size is not constant anylonger.
When I scroll through the list, the scrollbar size changes and when I start scrolling from the top of the list, the scrollbar moves, but the list stays where it is. Only when the scrollbar reaches a certain point, the list moves as well.
I have tried filtering the list with a CollectionViewSource, this solves the problem, but makes the triggering of visible/collapsed very slow when changing the property in the view model and refreshing the filtering of the collectionviewsource.
|
|
|
|
|
JackMalibu wrote: ObservableCollection of ViewModels - one ViewModel for each Row
Uhm seems a lot weird to me, surely a ViewModel is designed to service the View, not 1 line of a datagrid in a View, Sorry. I have no idea why the DG is pissed at you, I can understand why it is but can't help with the scroll issue. mutter mutter now thats the weirdest design I have come across yet
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
With "ViewModel" I mean a class that encapsulates all data for one row. Don't know what might be weird about this. It's just a capsule of data for the columns for each row plus the visibility flag.
|
|
|
|
|
Hi all,
I added to an already working (perhaps that was my mistake) a DataGridTemplateColumn containing a Button. The code looks like this:
<DataTemplate xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml' xmlns:local='clr-namespace:MyAssembly;assembly=MyAssembly>
<Button x:Name='btnShowSubgrid' Tag='{Binding ID}' Click='btnShowSubgrid_Click' Margin='4' Width='20'>
<Button.Content>
<Image x:Name='imgButtonTemplate' Source='Images/rightBlueArrow.png' />
</Button.Content>
</Button>
</DataTemplate>
All columns are runtime generated, and again, if I don't add this column, it all works fine.
This button's tag is bound to a column called "ID". There is another column that binds to "ID" but I don't think that's an issue. Even went as far as to remove all "embellisher" tags and content only leaving it with x:Name only but no luck.
This is how I add the column:
DataGridTemplateColumn buttonColumn = new DataGridTemplateColumn();
using (StreamReader reader = new StreamReader(Assembly.GetExecutingAssembly().GetManifestResourceStream("MyAssembly.CellTemplates.ButtonCellTemplate.xml")))
{
String str = reader.ReadToEnd();
str = str.Replace("(ColumnToBind)", _gridDefinition.SubGrid.Param);
buttonColumn.CellTemplate = (DataTemplate)XamlReader.Load(str);
}
dgGrid.Columns.Add(buttonColumn);
The ArgumentOutOfRangeException is thrown after the MainPage_Loaded event and it says:
Microsoft JScript runtime error: Unhandled Error in Silverlight Application
Code: 4004
Category: ManagedRuntimeError
Message: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: index
at System.Windows.PresentationFrameworkCollection`1.InsertDependencyObject(Int32 index, DependencyObject value)
at System.Windows.Controls.UIElementCollection.InsertInternal(Int32 index, UIElement value)
at System.Windows.PresentationFrameworkCollection`1.Insert(Int32 index, T value)
at System.Windows.Controls.DataGrid.InsertDisplayedColumnHeader(DataGridColumn dataGridColumn)
at System.Windows.Controls.DataGrid.OnApplyTemplate()
at System.Windows.FrameworkElement.OnApplyTemplate(IntPtr nativeTarget)
My DataGrid has AutoGenerateColumns set to "false". Has somebody have the same issue? How have you fixed it?
BTW, I'm using Silverlight 4.
All help is appreciated!
Thanks,
humble.apprentice
|
|
|
|
|
Hi
I want to host wpf controls in a legacy windows form. I have to do something like this
[code]
// In some windows form class
void SetWPFContent(UIElement content)
{
ElementHost ctrlHost = new ElementHost();
ctrlHost.Child = content;
ctrlHost.AutoSize = true;
ctrlHost.Dock = DockStyle.Fill;
Controls.Add(ctrlHost);
}
[/code]
The WPF control is put in the form. However, the ElementHost component always come out with the same odd size no matter what content is. Is there a way for me to resize ElementHost to make it fit the content?
thanks
|
|
|
|
|
Hi,
I have a ViewModel called MainWindowViewModel. In this I have a property that shows a modal window when an error occurs. This works fine as long as an error occurs during start-up.
When an error occurs after start-up, in SubViewModel, I invoke the parametrized constructor in MainWindowViewModel.
MainWindowViewModel.cs
public MainWindowViewModel()
{
if (!isServerRunning)
{
this.ModalWindow = new LogViewModel("Service is down.");
}
else
{
this.ModalWindow = new LogViewModel();
}
}
public MainWindowViewModel(string logMessage)
{
this.ModalWindow = new LogViewModel(logMessage);
}
public LogViewModel ModalWindow
{
get
{
return _modalWindow;
}
set
{
_modalWindow = value;
OnPropertyChanged("ModalWindow");
}
}
MainWindow.xaml
....
<Grid>
<vw:LogView Content="{Binding Path=ModalWindow}"/>
</Grid>
- MainWindowViewModel is bound to MainWindow.xaml
- SubViewModel is bound to SubView.xaml
- MainWindow.xaml loads multiple views, one of them is SubView.
In App.xaml I have created an instance of the ViewModel and bound it to MainWindow.
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
MainWindow mainWindow = new MainWindow();
MainWindowViewModel viewModel = new MainWindowViewModel();
mainWindow.DataContext = viewModel;
mainWindow.Show();
}
What I realized was that the modal window shows up when an error occurs after start-up if I create the modal window property in SubViewModel and bind it to SubView. But this is not ok since SubView is only a DockPanel covering 1/4 of the MainWindow. I.e. 1/4 is only covered with a modal window instead of the whole MainWindow.
I am not sure why modal window does not appear in MainWindow when I call the parametrized constructor from SubViewModel. When I debug I see that the part "_modalWindow = value;" has correct values but in any case the modal window does not show up.
I am binding the ViewModel to the Datacontext of the MainWindow. That's is probably why I see the Modal window when error occurs on start-up. For errors after start-up: Must I (from SubViewModel where I invoke the parametrized constructor in MainWindowViewModel) do some kind of binding to the datacontext of the Mainwindow again? How is the best way of doing this without having to create a new instance of MainWindow? Because MainWindow should only be created once.
Any help is much appreciated.
modified on Tuesday, June 14, 2011 4:33 AM
|
|
|
|
|
This problem is solved.
I passed the instance MainWindowViewModel to SubViewModel and used that instance in SubViewModel to set the property in MainWindowViewModel.
|
|
|
|
|
I have a project (LKCommon) set up in my app solution to hold common resources - I have added a reference to that assembly to the main assembly and then try to access the resources using:
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/LKCommon;component/Styles.xaml" />
</ResourceDictionary.MergedDictionaries>
<!-- Converters -->
<converters:OrientationToAngleConverter x:Key="OrientationToAngleConverter" />
</ResourceDictionary>
</UserControl.Resources>
If I change any of the pack uri string it says it can no longer find the file (so it seems to be finding it during development) but as soon as I run the application I get a file not found exception for that resource dictionary.
What am I doing wrong?
|
|
|
|
|
I think you need to get rid of the application:,,, portion and it should work. Where 'xxx' is the assembly name minus the extension. What you have now is trying to load out of the exe.
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/xxx;component/Themes/Generic.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
|
|
|
|
|
I tried that but it didn't work at the UserControl level - only at the Application level. So that is what I have gone for. Thanks for your reply.
|
|
|
|
|
Hi
I am getting this error when I am trying to call sharepoint 2010 client object model in my silverlight application.Error:The property or field has not been initialized. It has not been requested or the request has not been executed. It may need to be explicitly requested.
using (SP.ClientContext objSite = new SP.ClientContext("http://Sharepoint:80/"))
{
SP.CamlQuery objCaml = new SP.CamlQuery();
objCaml.ViewXml = @"<View></View>";
SP.Web objWeb = objSite.Web;
SP.List list = objWeb.Lists.GetByTitle("BackgroundImages");
listItems = list.GetItems(objCaml);
objSite.Load(objWeb);
objSite.Load(list);
objSite.Load(listItems);
objSite.ExecuteQueryAsync(Succeeded, Failed);
}
Please help
|
|
|
|