|
Great question, I have been wondering this for some time but haven't gotten around to trying it. I can't find any examples online for this, but I'm sure a WPF MediaElement or other control can be embedded inside a webpage, I'm just not sure how.
madness ? this.isSparta = true : this.isSparta = false;
modified on Friday, June 6, 2008 4:47 PM
|
|
|
|
|
In the WPF window, i have a check box that i want to be checked and make the program stay up top of all others.
this.TopMost();
But i keep getting this error
Error 1 Non-invocable member 'System.Windows.Window.Topmost' cannot be used like a method. C:\Documents and Settings\Nick\My Documents\Visual Studio 2008\Projects\Bleach Player\Bleach Player\Window1.xaml.cs 36 18 Bleach Player<br />
I've tried to throw an exception and that just threw me down a long road of errors.
Anyone explain why i can't do this or use this:
<br />
if (Change.Checked)<br />
{ FormBorderStyle = FormBorderStyle.None; }<br />
else <br />
{ FormBorderStyle = FormBorderStyle.SizableToolWindow; }
To change the window border frame?
Btw, i know this is in the WPF forum, not C# as the codes above are. Before you start flaming i understand this but i am creating a WPF window not a C# program.
|
|
|
|
|
TopMost is a propterty, so try:
this.TopMost = true;
I'm assuming Change is a CheckBox, and in that case you can't do if (Change.Checked) because Checked is an event. Use IsChecked which is of type bool? (? means it is nullable as in System.Nullable):
if ((bool)Change.IsChecked)
I don't know where FormBorderStyle came from. If you're using a System.Windows.Window use
WindowStyle = WindowStyle.None;
and
WindowStyle = WindowStyle.ToolWindow;
|
|
|
|
|
Thanks, these worked, had to change TopMost to Topmost though.
modified on Friday, June 6, 2008 7:06 AM
|
|
|
|
|
Hi all,
I am trying to build a game based on the WPF and WCF. Client and server work fine on my machine(Vista 64), they are connected successful. But when I am trying to run server on the LAN machine(WinXp) and client on my machine(Vista 64), after calling service metod from client application I get exception:
"Fail agreement of mode security SOAP from "http://192.168.0.55:8080/Pf\" for object "http://192.168.0.55:8080/Pf\"."????
Help please to resolve the problem.
|
|
|
|
|
Have you configured the security on your bindings yet? I'd try turning the security off on both client and server bindings add see if that allows calls through.
Replace the WSHttpBinding with the type of binding you're using and set the security mode to None.
WSHttpBinding binding = new WSHttpBinding(SecurityMode.None);
or if the binding is in a config file:
<security mode="None"/>
If that works then your problem is with security.
|
|
|
|
|
Brian thanks for help.
Here is the cut of my server app.config file:
<bindings>
<wsDualHttpBinding>
<binding name="WSDualHttpBinding_IPref">
<security mode="None"/>
</binding>
</wsDualHttpBinding>
</bindings>
Here is is the cut of my client app.config file:
<bindings>
<wsDualHttpBinding>
<binding name="WSDualHttpBinding_IPref" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00" />
<security mode="Message">
<message clientCredentialType="Windows" negotiateServiceCredential="true"
algorithmSuite="Default" />
</security>
</binding>
</wsDualHttpBinding>
</bindings>
If I change
<security mode="Message">
<message clientCredentialType="Windows" negotiateServiceCredential="true"
algorithmSuite="Default" />
</security>
to
<security mode="None">
</security>
It fails with something like this:
"Operation of opening doesn't complete in the course of defined period 00:01:00"
even if the server and the client are running on my machine.
|
|
|
|
|
It may need the message element (both files):
<security mode="None">
<message clientCredentialType="None" negotiateServiceCredential="false"
algorithmSuite="Default" />
</security>
I did a quick test with the binding. The server on vista64 and client on XP. After turning off the firewalls it worked. The only difference is I didn't use a config file, just hard coded everything for the test. If you'd like I can post it.
|
|
|
|
|
Ok, I'll try to do this.
If it's possibly, please send me to losqut@yandex.ru
|
|
|
|
|
Hi All!
I found Silverlight User Control Template is missing when i create a new Asp.Net project.
Does Anybody know what to do to add that template to Visual Studio 2008
Thanks and Regards
Vijay. R
|
|
|
|
|
Please take a look at my reply in your previous message http://www.codeproject.com/script/Forums/View.aspx?fid=1004257&msg=2584440[^]
In Silverlight 2 beta1, all default templates for all user controls are stored in generic.xaml. If you are creating custom database which is inherited from build-in control, you will need to use those styles from generic.xaml unless you create all required template by yourself.
|
|
|
|
|
Hi Friends,
I am unable to create docking control in silver light 2.0.My requirement is I am using one menu control in silver light,I want to apply docking to that control.So I am unable to do that,can u pleaes help me in this.
Regards
Kishore
|
|
|
|
|
|
Hi,
I am using visual studio 2008 to code behind my silverlight application(drag and drop). I have been browse ans see the sample from online and silverlight book. But i having the problem here.
When I loaded the silverlight application in asp.net
Page.xaml
<canvas x:name="parentCanvas">
x:Class="SilverlightApplication5.Page"
xmlns="http://schemas.microsoft.com/client/2007"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Loaded="parentCanvas_Loaded"
Width="400" Height="300" Background="Aquamarine">
x:Name="submit" Width="100" Height="200" Canvas.Top="100" Background="Azure" >
Page.xaml.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
namespace SilverlightApplication5
{
public partial class Page : Canvas
{
private void parentCanvas_Loaded(object sender, RoutedEventArgs e)
{
InitializeComponent();
}
}
}
The mozilla browser do not show up any silverlight content,jz blank it where I have plug in the silverlight in asp.net.
When I remove the "LOADED" element from the Page.xaml and use direct InitializeComponent() in Public Page(), it works.
So, what is the problem with this??
Thanks.
Regards,
Katelva
|
|
|
|
|
Please check "Ignore HTML tags in this message" when you are posting XAML, XML or HTML code.
I need to look at the your Page.xaml to find out the error.. Could you please post your XAML code?
|
|
|
|
|
Page.xaml
x:Class="SilverlightApplication5.Page"
xmlns="http://schemas.microsoft.com/client/2007"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Loaded="parentCanvas_Loaded"
Width="400" Height="300" Background="Aquamarine">
<button> x:Name="submit" Width="100" Height="200" Canvas.Top="100" Background="Azure" > </button>
|
|
|
|
|
Hi All,
I'm just working on the Skinning code/xaml and i'm seeing a really odd error:
Cannot convert the value in attribute 'Color' to object of type 'System.Windows.Media.Color'. '#FF323232' is not a valid value for property 'Color'. Error at object 'PassWordBoxBackground.Default' in markup file 'Utils.WPFThemes.Default;component/DefaultTheme_SolidColorBrushes.xaml' Line 74 Position 66.
I was under the impression that a DynamicResource could be fed by another DynamicResource ... am I wrong here or this due to a different problem? I have other instances of a this setup that appear to be working.
<solidcolorbrush x:key="PassWordBoxBackground.Default" color="{DynamicResource AppBackground.Default}" />
Cheers,
Jammer
Going where everyone here has gone before!
My Blog
|
|
|
|
|
Hi!
I am creating a ControlTemplate for a Button. A button gets it's 3D look with BevelBitmapEffect which is applied to the Canvas which holds the controls that are used in the template. I meant to use the HorizontalContentAlignment and VerticalContentAlignment properties of the button to Rotate the button. I also need to change the LightAngle of the BevelBitmapEffect when the button is rotated. Here is an simplified example:
<ControlTemplate x:Key="ArrowBtnTmp" TargetType="{x:Type ButtonBase}">
<Viewbox Stretch="Uniform">
<Canvas Width="136" Height="52">
<Path Width="135.046" SnapsToDevicePixels="True"
Height="51.862"
Fill="{TemplateBinding Background}"
Stretch="Fill"
Canvas.Left="0"
Canvas.Top="0"
Data="..."/>
<Canvas.BitmapEffect>
<BevelBitmapEffect x:Name="BevelEffect" LightAngle="135" />
</Canvas.BitmapEffect>
<Canvas.RenderTransform>
<RotateTransform x:Name="RotateTransform" Angle="0" />
</Canvas.RenderTransform>
</Canvas>
</Viewbox>
<ControlTemplate.Triggers>
<Trigger Property="HorizontalContentAlignment" Value="Right">
<Setter TargetName="BevelEffect" Property="LightAngle" Value="225" />
<Setter TargetName="RotateTransform" Property="Angle" Value="90" />
</Trigger>
<Trigger Property="VerticalContentAlignment" Value="Bottom">
<Setter TargetName="BevelEffect" Property="LightAngle" Value="315" />
<Setter TargetName="RotateTransform" Property="Angle" Value="180" />
</Trigger>
<Trigger Property="HorizontalContentAlignment" Value="Left">
<Setter TargetName="BevelEffect" Property="LightAngle" Value="45" />
<Setter TargetName="RotateTransform" Property="Angle" Value="270" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
But the example does not work. I get a compile error saying:
Cannot find the trigger target BevelEffect.
Am I missing something, or this is not the right way to solve my problem. Does anybody has a better solution? Any advice will be greatly appreciated!
Uros
|
|
|
|
|
Study this example. The Bitmap Effect is a complex class and not just properites, so the trigger must set the properties different.
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Class="Window1" x:Name="Window" Title="Window1" Width="640" Height="480">
<Window.Resources>
<ControlTemplate x:Key="ButtonControlTemplate1" TargetType="{x:Type Button}">
<Canvas Width="136" Height="52" x:Name="layoutRoot">
<Canvas.BitmapEffect>
<BevelBitmapEffect />
</Canvas.BitmapEffect>
<Ellipse Width="136" Height="52" Fill="#FFF05151" Stroke="#FF000000" />
</Canvas>
<ControlTemplate.Triggers>
<Trigger Property="HorizontalContentAlignment" Value="Right">
<Setter Property="BitmapEffect" TargetName="layoutRoot">
<Setter.Value>
<BevelBitmapEffect LightAngle="225" />
</Setter.Value>
</Setter>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Window.Resources>
<Grid x:Name="LayoutRoot">
<Button HorizontalAlignment="Left" VerticalAlignment="Top" Content="Button" Template="{DynamicResource ButtonControlTemplate1}" HorizontalContentAlignment="Center" />
</Grid>
</Window>
Cheers, Karl
» CodeProject 2008 MVP
» Microsoft MVP - Client App Dev
My Blog | Mole's Home Page | MVP Profile
Just a grain of sand on the worlds beaches.
-- modified 27-Feb-21 21:01pm.
|
|
|
|
|
Hi all.
Iam new to Wpf..I want to know how to use crystal report In wpf?
Please help me
|
|
|
|
|
|
Good day folks,
Is it possible to use WPF's media components to create an MP3 player? I would want the MP3 player to have the usual functions (i.e. list of songs, time elapsed/left, random/sequential play, loop, fast forward, etc... you get the picture). Also, I would also want the user to be able to add mp3 to it.
Any help or direction you can provide will be greatly appreciated. Also, if WPF's media component can't do it, are there any third party MP3 player's for WPF?
Thanks,
BP
|
|
|
|
|
There are 100's of example programs using the MediaElement control on the web. Many here on Code Project.
modified 27-Feb-21 21:01pm.
|
|
|
|
|
Hi All!
Somebody Please Help/Guide me to complete my module.
Tools Used
-----------
Asp.Net Server Control (Asp.Net 3.5)
Windows XP
Code Behind is visual basic
My Module
----------
I want to create a Button control. When it is clicked a function named GoNext() will be called and the definition of the GoNext() will be given in the code behind of the EndUser WebForm(i.e where the control is going to be used).
My Source Code is:
------------------
Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Text
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Namespace SfNextCmd
<defaultproperty("text"), toolboxdata(=""><{0}:sfnextcmd runat="server">")> _
Public MustInherit Class SfNextCmd
Inherits Button
Public MustOverride Function GoNext()
Private Sub SfNextCmd_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Click
GoNext()
End Sub
End Class
End Namespace
Also if it is possible thro SilverLight Please send me the source code.
By Vijay
|
|
|
|
|
VijaySofist wrote: Also if it is possible thro SilverLight Please send me the source code.
Just calling a function on click event? It's possible to do in Silverlight. Just place a button on Page.xaml and subscribe the click event on constructor of Page.xaml.cs. Then, call the function..
If you are not familiar with Silverlight, please read this doc. http://www.silverlight.net/quickstarts/managed.aspx[^]
Hope it helps.
|
|
|
|