Click here to Skip to main content
15,892,072 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: How to copy a TList? Pin
Edbert P1-Sep-09 16:46
Edbert P1-Sep-09 16:46 
GeneralRe: How to copy a TList? Pin
CBenac2-Sep-09 3:04
CBenac2-Sep-09 3:04 
GeneralRe: How to copy a TList? Pin
Edbert P3-Sep-09 16:20
Edbert P3-Sep-09 16:20 
QuestionHow to capture Child Name and the Parent Name in a tree view in WPF + MVP Pin
Krishna Aditya1-Sep-09 2:09
Krishna Aditya1-Sep-09 2:09 
AnswerRe: How to capture Child Name and the Parent Name in a tree view in WPF + MVP Pin
Richard MacCutchan1-Sep-09 12:15
mveRichard MacCutchan1-Sep-09 12:15 
QuestionUpdate silverlight xap file Pin
Nekkantidivya31-Aug-09 19:18
Nekkantidivya31-Aug-09 19:18 
AnswerRe: Update silverlight xap file Pin
zlezj1-Sep-09 0:49
zlezj1-Sep-09 0:49 
AnswerRe: Update silverlight xap file - Sample code Pin
zlezj1-Sep-09 2:23
zlezj1-Sep-09 2:23 
OK, here's an extended version. This code appends the file date/time to the XAP file name. This way you'll keep the caching of already loaded XAP files and you don't have to remember to change the number...

<%@ Page Language="C#" AutoEventWireup="true" %>
<script runat="server">
    protected override void OnLoad(EventArgs e)
    {
        base.OnLoad(e);

        const string XAP = "ClientBin/XapFile.xap";
        System.IO.FileInfo fi = new System.IO.FileInfo(Request.MapPath("./" + XAP));
        string timeStampXAP = fi.LastWriteTime.ToString("yyyyMMdd_HHmmss");
        source.Text = String.Format("<param name=\"source\" value=\"{0}?{1}\" />", XAP, timeStampXAP);
    }

</script>
<%@ OutputCache Duration="1" VaryByParam="None" Location="None" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Test</title>
    <style type="text/css">
    html, body {
	    height: 100%;
	    overflow: auto;
    }
    body {
	    padding: 0;
	    margin: 0;
    }
    form {
    	height: 100%;
    }
    #host {
	    height: 100%;
	    text-align:center;
    }
    </style>
    <script type="text/javascript" src="Silverlight.js"></script>
    <script type="text/javascript">
        window.onload = function()
        {
            document.getElementById('host').focus();
        }

        function onSilverlightError(sender, args) {
            var appSource = "";
            if (sender != null && sender != 0) {
                appSource = sender.getHost().Source;
            }

            var errorType = args.ErrorType;
            var iErrorCode = args.ErrorCode;

            if (errorType == "ImageError" || errorType == "MediaError") {
                return;
            }

            var errMsg = "Unhandled Error in Silverlight Application " + appSource + "\n";

            errMsg += "Code: " + iErrorCode + "    \n";
            errMsg += "Category: " + errorType + "       \n";
            errMsg += "Message: " + args.ErrorMessage + "     \n";

            if (errorType == "ParserError") {
                errMsg += "File: " + args.xamlFile + "     \n";
                errMsg += "Line: " + args.lineNumber + "     \n";
                errMsg += "Position: " + args.charPosition + "     \n";
            }
            else if (errorType == "RuntimeError") {
                if (args.lineNumber != 0) {
                    errMsg += "Line: " + args.lineNumber + "     \n";
                    errMsg += "Position: " + args.charPosition + "     \n";
                }
                errMsg += "MethodName: " + args.methodName + "     \n";
            }

            throw new Error(errMsg);
        }
    </script>
</head>
<body>
    <form id="form1" runat="server" enableviewstate="false">
    <div id="host">
        <object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
		<asp:Literal ID="source" runat="server" />
		<param name="onError" value="onSilverlightError" />
		<param name="background" value="white" />
		<param name="minRuntimeVersion" value="3.0.40624.0" />
		<param name="autoUpgrade" value="true" />
		  <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=3.0.40624.0" style="text-decoration:none">
 			  <img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style:none"/>
		  </a>
	    </object><iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe></div>
    </form>    
</body>
</html>

GeneralRe: Update silverlight xap file - Sample code Pin
Nasenbaaer2-Jun-10 5:06
Nasenbaaer2-Jun-10 5:06 
AnswerRe: Update silverlight xap file Pin
Mark Salsbery1-Sep-09 5:28
Mark Salsbery1-Sep-09 5:28 
QuestionWPF CheckBox state Pin
Gary Wheeler31-Aug-09 9:47
Gary Wheeler31-Aug-09 9:47 
AnswerRe: WPF CheckBox state [modified] Pin
Super Lloyd31-Aug-09 14:43
Super Lloyd31-Aug-09 14:43 
GeneralRe: WPF CheckBox state Pin
Gary Wheeler1-Sep-09 0:55
Gary Wheeler1-Sep-09 0:55 
GeneralRe: WPF CheckBox state Pin
Super Lloyd1-Sep-09 0:58
Super Lloyd1-Sep-09 0:58 
GeneralRe: WPF CheckBox state Pin
Gary Wheeler1-Sep-09 1:11
Gary Wheeler1-Sep-09 1:11 
GeneralRe: WPF CheckBox state Pin
Super Lloyd1-Sep-09 1:27
Super Lloyd1-Sep-09 1:27 
GeneralRe: WPF CheckBox state Pin
Gary Wheeler1-Sep-09 1:35
Gary Wheeler1-Sep-09 1:35 
QuestionDynamic enumlist Pin
ProgrammerWPF31-Aug-09 8:43
ProgrammerWPF31-Aug-09 8:43 
AnswerRe: Dynamic enumlist Pin
Not Active31-Aug-09 9:54
mentorNot Active31-Aug-09 9:54 
GeneralRe: Dynamic enumlist Pin
ProgrammerWPF31-Aug-09 9:57
ProgrammerWPF31-Aug-09 9:57 
GeneralRe: Dynamic enumlist Pin
Not Active31-Aug-09 10:10
mentorNot Active31-Aug-09 10:10 
GeneralRe: Dynamic enumlist Pin
ProgrammerWPF31-Aug-09 10:19
ProgrammerWPF31-Aug-09 10:19 
GeneralRe: Dynamic enumlist Pin
Not Active31-Aug-09 10:44
mentorNot Active31-Aug-09 10:44 
GeneralRe: Dynamic enumlist Pin
Pete O'Hanlon31-Aug-09 10:49
mvePete O'Hanlon31-Aug-09 10:49 
QuestionBinding DataSet to TreeView problem [Question specifically for Josh Smith/Anyone else who can help] Pin
Etienne_12331-Aug-09 7:09
Etienne_12331-Aug-09 7:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.